Hash from two arrays: Difference between revisions

(added objective c)
Line 317:
from itertools import izip
hash = dict(izip(keys, values))
</lang>
 
{{works with|Python|3.0+}}
Shows off the dict comprehensions in Python 3:
<lang python>
keys = ['a', 'b', 'c']
values = [1, 2, 3]
hash = {key: value for key, value in zip(keys, values)}
</lang>
 
Anonymous user