Hey guys in this video i am gonna tell you how you can convert 2 lists to dictionary in python |
Source Code..
#creating two list
list1 = [70, 50, 100, 60]
list2 = ['python', 'java', 'rust', 'go']
#converting into dictionary using zip function
dictionary = dict(zip(list2, list1))
#printing a dictionary
print(dictionary['python'])

0 Comments