Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
python
SUBMITTED BY:
Guest
DATE:
April 3, 2013, 12:01 p.m.
FORMAT:
Text only
SIZE:
251 Bytes
Raw
Download
Tweet
HITS:
1087
Go to comments
Report
>>> zip([1,2,3], ['a','b','c'])
[(1, 'a'), (2, 'b'), (3, 'c')]
>>> a = ['a','b','c']
>>> b = range(3)
>>> b
[0, 1, 2]
>>> d = {key: value for (key, value) in zip(a,b) }
>>> d
{'a': 0, 'c': 2, 'b': 1}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus