Create dictionary from fromkeys() function : Fromkeys : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Fromkeys »

 

Create dictionary from fromkeys() function


print {}.fromkeys('xyz')
print {}.fromkeys(('love', 'honor'), True)

# More Than One Entry per Key Not Allowed

dict1 = {' foo':789'foo': 'xyz'}
print dict1
dict1['foo'] 123
print dict1



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Dictionary
» Fromkeys