list to map?

Bruce Guenter bruce.guenter at qcc.sk.ca
Tue May 18 17:04:32 EDT 1999


Greetings.

I have a list of two-item tuples:
	x=[(1,2),(3,4),(5,6)...]
Is there a built-in way to turn this into a map:
	{1:2,3:4,5:6...}
I have done the obvious of looping over the tuples and adding them to a
map, but was wondering if there was a different way.
-- 
Bruce Guenter, QCC Communications Corp.  EMail: bruce.guenter at qcc.sk.ca
WWW: http://www.qcc.sk.ca/~bguenter/
Go ahead!  SPAM me at bait at qcc.sk.ca




More information about the Python-list mailing list