a dictionary from a list

Leif K-Brooks eurleif at ecritters.biz
Fri Jun 24 18:28:46 EDT 2005


David Bear wrote:
> Is there an easy way to create a dictionary object with the members of
> 'alist' being the keys in the dictionary, and the value of the keys set to
> null?

adict = dict.fromkeys(alist)



More information about the Python-list mailing list