I like the Python list comprehension syntax.
Can it be used to create dictionaries too? For example, by iterating over pairs of keys and values:
mydi
In Python 2.7, it goes like:
>>> list1, list2 = ['a', 'b', 'c'], [1,2,3] >>> dict( zip( list1, list2)) {'a': 1, 'c': 3, 'b': 2}
Zip them!