FireNWater wrote: > I'm curious why the different outputs of this code. If I make the > dictionary with letters as the keys, they are not listed in the > dictionary in alphabetical order, but if I use the integers then the > keys are in numerical order. > > I know that the order of the keys is not important in a dictionary, > but I was just curious about what causes the differences. Thanks!!
Currently the order of dict keys depend on the hash of the object. Try hash(1) and hash('a'). -- http://mail.python.org/mailman/listinfo/python-list