Mega Code Archive
Categories
/
Python Tutorial
/
Dictionary
Use the dict function to construct dictionaries from (key, value) pairs
items = [('name', 'Gumby'), ('age', 42)] d = dict(items) print d print d['name']