How to convert two lists to a dictionary in Python

1 Answer

0 votes
lst1 = ["python", "php" , "java" , "c#"]
lst2 = [34, 872, 2, 9761]
 
dic = dict(zip(lst1, lst2))
 
print(dic)
 
 
 
'''
run:
 
{'python': 34, 'php': 872, 'java': 2, 'c#': 9761}
 
'''

 



answered Jan 29, 2020 by avibootz
...