use the dict function to construct dictionaries from (key, value) pairs : Convert to Dictionary : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Convert to 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']



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Dictionary
» Convert to Dictionary