How to combine two lists into a dictionary in Python

1 Answer

0 votes
key = ['Name', 'Age', 'Language']
value = ['R2D2', 60, 'C']

kv = zip(key, value)
d = dict(kv)

print(d)



'''
run:

{'Name': 'R2D2', 'Age': 60, 'Language': 'C'}

'''

 



answered Oct 5, 2021 by avibootz
...