Sign up for Free !!
World's first open source developer community with
Ticketing System
I have two lists
L1=['NAME','AGE','EMAIL','GENDER'] L2=['SOUMYA','22','soumya22@gmail.com','female']
I want the output as :
{'NAME':'SOUMYA','AGE':'22','EMAIL':'soumya22@gmail.com','GENDER':'FEMALE'}
Here we have to use zip() function to combine two lists
The solution is:
L1=['NAME','AGE','EMAIL','GENDER'] L2=['SOUMYA','22','soumya22@gmail.com','female'] d=dict(zip(L1,L2)) print(d)
Output :
{'NAME': 'SOUMYA', 'AGE': '22', 'EMAIL': 'soumya22@gmail.com', 'GENDER': 'female'}
Please Login/Register to write your answer !!!
Here we have to use zip() function to combine two lists
The solution is:
Output :