David Bear wrote: > Assume I have a list object called 'alist'. > > 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?
You mean None, right? :)
>>> a_list = [1, 2, 3, 'a', 'b', 'c']
>>> dict.fromkeys(a_list)
{'a': None, 1: None, 2: None, 3: None, 'c': None, 'b': None}
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
