[Tutor] minor display issue with python dictionaries
Reuben
reuben.dlink at gmail.com
Sun Nov 24 17:03:11 CET 2013
Hi,
##########################################
>>>
>>> new_dict = {'a':10, 'b' :20, 'c': 30,'d' : 40}
>>>
>>>
>>> print new_dict
{'a': 10, 'c': 30, 'b': 20, 'd': 40}
>>>
#########################################
>From the above output, I see key 'c' is at third position during input, but
while displaying the output it is displayed at second position
Although, I dont see any impact of it since we mainly refer to dictionary
values only using "keys" -- but just for curiosity why is this position
change?
Regards,
Reuben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131124/7ba3d11a/attachment.html>
More information about the Tutor
mailing list