Answers for "how to make a python dict from key and value listss"

2

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

list of dict values

list(d.values())
Posted by: Guest on June-12-2020

Code answers related to "how to make a python dict from key and value listss"

Python Answers by Framework

Browse Popular Code Answers by Language