use the dict function to construct dictionaries from (key, value) pairs : Convert to Dictionary « Dictionary « Python Tutorial






items = [('name', 'Gumby'), ('age', 42)]
d = dict(items)
print d
print d['name']








8.5.Convert to Dictionary
8.5.1.use the dict function to construct dictionaries from (key, value) pairs
8.5.2.dict can be used with keyword arguments
8.5.3.dictionaries may be created using the factory function dict().
8.5.4.Mapping Type Related Functions with dict()