dict comprehension

Paul Rubin http
Fri Feb 1 07:10:14 CET 2008

"Daniel Fetchinson" <fetchinson at googlemail.com> writes:
> What does the author mean here? What's the Preferably One Way (TM) to
> do something analogous to a dict comprehension?

from itertools import izip
d = dict((k,v) for k,v in izip(keys, values))

More information about the Python-list mailing list