Answers for "create a dict of lists python"

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
1

create dict from two lists

keys = ['a', 'b', 'c']
values = [1, 2, 3]
dictionary = dict(zip(keys, values))
Posted by: Guest on March-16-2021

Code answers related to "create a dict of lists python"

Python Answers by Framework

Browse Popular Code Answers by Language