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"
Dictionaries store their values in the most efficient way for key lookup
they do not store them in order. In fact t
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 indeterm
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"
Why not:
>>> abdict
{'a':1,'b':2,'c':3,'d':4,'e':5}
Is there any hidden logic in the code that