Setting variable values from dictionary

Sean Berry sean at sands.beach.net
Fri Apr 23 11:11:34 EDT 2004


If I have a dictionary like the following:

{'category' : 2, 'shape', 4}

How can I use this to make
category = 2 and 
shape = 4.

I want to be able to do this regardless of the dict values type.  So:

{'cateogry' : 2, 'shape' : 'circle'}

will work as well.


Thanks in advance for any help.  You guys rock.

-- 



More information about the Python-list mailing list