opposite of dict.items()

Tertius tcronj at ananzi.co.za
Thu Aug 28 23:34:57 CEST 2003


Tertius wrote:
> Is there a method to create a dict from a list of keys and a list of 
> values ?
> 
> TIA
> Tertius
> 

I found a way...

a = {}
for k , v in zip(keys,values):
	a[k] = v

thnx
Tertius





More information about the Python-list mailing list