Srinivas Iyyer wrote: > Hi all: > > Here is a simple code: > > >>>>a = ['a','b','c','d','e'] >>>>b = [1,2,3,4,5] >>>>abdict = dict(zip(a,b)) >>>>abdict > > {'a': 1, 'c': 3, 'b': 2, 'e': 5, 'd': 4} > > > Why is this weird iteration going on"
The order of keys in a dict is effectively indeterminate. It does not reflect the order in which the entries are added to the dict and may change over time as entries are added and deleted. This is a side-effect of the way dicts are implemented (as hash tables). Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor