python / sets / dictionary / initialization
- by Mario D
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()]