opposite of dict.items()

Peter Otten __peter__ at web.de
Thu Aug 28 17:33:27 EDT 2003


Tertius wrote:

> Is there a method to create a dict from a list of keys and a list of
> values ?

>>> dict(zip(range(3), "abc"))
{0: 'a', 1: 'b', 2: 'c'}

Not a method() but a method.

Peter






More information about the Python-list mailing list