Possible Duplicate:
python looping seems to not follow sequence?
In what order does python display dictionary keys?
d = {'x': 9, 'y': 10, 'z': 20}
for key in d:
print d[key]
The above code give different outputs every time I run it. Not exactly different outputs, but output in different sequence. I executed the code multiple times using Aptana 3.
First Execution Gave: 10 9 20
Second Execution Gave: 20 10 9
I also executed the code in an online IDE http://labs.codecademy.com. There the output was always 10 9 20
I just wanted to know why is this. Ideally it should have printed 9 10 20 every time I execute the above code. Please Explain.