Mega Code Archive

 
Categories / Python Tutorial / Dictionary
 

Fromkeys method creates a new dictionary with the given keys, each with a default corresponding value of None

print {}.fromkeys(['name', 'age'])