Answers for "how do you intialize a dictionary in python"

1

initialize a dict from list

dict.fromkeys(["key1", "key2", "key3"], "value")
{'key1': 'value', 'key2': 'value', 'key3': 'value'}
Posted by: Guest on December-05-2020

Code answers related to "how do you intialize a dictionary in python"

Python Answers by Framework

Browse Popular Code Answers by Language