Hash from two arrays: Difference between revisions
Content deleted Content added
→[[Ruby]]: flatten appears to be necessary here |
|||
Line 168:
[[Category:Python]]
'''Interpreter:''' [[Python]] 2.5
<pre>
values = [1, 2, 3]
# Lazily:
from itertools import izip
hash = dict(izip(keys, values))
</pre>
==[[Ruby]]==
|