Answers for "python create dict with list of keys"

1

create dictionary key and values from lists

keys = ['a', 'b', 'c']
values = [1, 2, 3]
dictionary = dict(zip(keys, values))
print(dictionary) # {'a': 1, 'b': 2, 'c': 3}
Posted by: Guest on September-14-2021
0

create a list of the keys in python dictionary

#Where the dictionary has the name, dict
dict.keys()
Posted by: Guest on August-12-2021

Code answers related to "python create dict with list of keys"

Python Answers by Framework

Browse Popular Code Answers by Language