python / sets / dictionary / initialization

Posted by Mario D on Stack Overflow See other posts from Stack Overflow or by Mario D
Published on 2012-04-15T23:10:58Z Indexed on 2012/04/15 23:29 UTC
Read the original article Hit count: 233

Can someone explain help me understand how the this bit of code works? Particularly how the myHeap assignment works. I know the freq variable is assigned as a dictionary. But what about my myHeap? is it a Set?

    exe_Data = {
      'e' : 0.124167,
      't' : 0.0969225,
      'a' : 0.0820011,
      'i' : 0.0768052,
     }

    freq = exe_Data)

    myHeap = [[pct, [symbol, ""]] for symbol, pct in freq.items()]

© Stack Overflow or respective owner

Related posts about python

Related posts about dictionary