Re: [Tutor] key/value order in dictionaries

2008-07-31 Thread Chris Fuller
On Thursday 31 July 2008 05:33, Monika Jisswel wrote: > Python dictionaries are not ordered & the order you will get when you print > a dictionary is the order that the python virtual machines thinks optimal > for that dictionary for its own internal procedures. If you need an ordered dictionary,

Re: [Tutor] key/value order in dictionaries

2008-07-31 Thread Monika Jisswel
Python dictionaries are not ordered & the order you will get when you print a dictionary is the order that the python virtual machines thinks optimal for that dictionary for its own internal procedures. ___ Tutor maillist - Tutor@python.org http://mail.

Re: [Tutor] key/value order in dictionaries

2008-07-31 Thread Tim Golden
Steve Poe wrote: Hi tutor list, In dictionaries, I know that the keys are immutable, and the values can change What about the place/order of the key/order? I thought that they were sequential and they do not change. You were wrong :) A lot of electronic ink has been spilt on this subject ov

[Tutor] key/value order in dictionaries

2008-07-30 Thread Steve Poe
Hi tutor list, In dictionaries, I know that the keys are immutable, and the values can change What about the place/order of the key/order? I thought that they were sequential and they do not change. >>> D={"AAA":1234,"BBB":3456,"CCC":7890} >>> print D {'AAA': 1234, 'BBB': 3456, 'CCC': 7890} >