Re: [Tutor] minor display issue with python dictionaries

2013-11-24 Thread Joel Goldstick
On Sun, Nov 24, 2013 at 8:22 PM, Joel Goldstick wrote: > On Sun, Nov 24, 2013 at 8:12 PM, Steven D'Aprano wrote: >> On Sun, Nov 24, 2013 at 09:33:11PM +0530, Reuben wrote: >> [...] >>> From the above output, I see key 'c' is at third position during input, but >>> while displaying the output it i

Re: [Tutor] minor display issue with python dictionaries

2013-11-24 Thread Joel Goldstick
On Sun, Nov 24, 2013 at 8:12 PM, Steven D'Aprano wrote: > On Sun, Nov 24, 2013 at 09:33:11PM +0530, Reuben wrote: > [...] >> 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 > > Dictionaries are deliberate

Re: [Tutor] minor display issue with python dictionaries

2013-11-24 Thread Steven D'Aprano
On Sun, Nov 24, 2013 at 09:33:11PM +0530, Reuben wrote: [...] > 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 Dictionaries are deliberately made unordered. That means the order that items will be displa

Re: [Tutor] minor display issue with python dictionaries

2013-11-24 Thread Amit Saha
On Mon, Nov 25, 2013 at 2:55 AM, Joel Goldstick wrote: > On Sun, Nov 24, 2013 at 11:03 AM, Reuben wrote: >> Hi, >> >> ## > > new_dict = {'a':10, 'b' :20, 'c': 30,'d' : 40} > > > print new_dict >> {'a': 10, 'c': 30, 'b': 20, 'd': 40}

Re: [Tutor] minor display issue with python dictionaries

2013-11-24 Thread Joel Goldstick
On Sun, Nov 24, 2013 at 11:03 AM, Reuben wrote: > Hi, > > ## new_dict = {'a':10, 'b' :20, 'c': 30,'d' : 40} print new_dict > {'a': 10, 'c': 30, 'b': 20, 'd': 40} > > > # > > > From the abo

[Tutor] minor display issue with python dictionaries

2013-11-24 Thread Reuben
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