a dictionary from a list

Leif K-Brooks eurleif at ecritters.biz
Sat Jun 25 00:28:46 CEST 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