Merging two lists as a dictionary
Chris Frost
chris at frostnet.advicom.net
Wed Jul 21 00:09:30 EDT 1999
On Tue, Jul 20, 1999 at 10:13:16PM -0500, Charles G Waldman wrote:
> Unless I'm missing the point (which happens more than I'd like to
> admit!) I think what you're looking for is just:
>
> dicp={}
> for key,value in map(None,key_list,value_list):
> dict[key]=value
Perfect! (I wasn't sure on how to do the last line...)
thanks,
--
Chris Frost | <http://www.frostnet.advicom.net/chris/>
-------------+------------------------------------------
Public PGP Key:
Email chris at frostnet.advicom.net with the subject "retrieve pgp key"
or visit <http://www.frostnet.advicom.net/chris/about/pgp_key.phtml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 256 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/19990721/4f247f79/attachment.sig>
More information about the Python-list
mailing list