This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l1=[1,2,3,4] | |
l2=['a','b','c','d'] | |
d1=zip(l1,l2) | |
print (d1)#Output:<zip object at 0x01149528> | |
#Converting zip object to dict using dict() contructor. | |
print (dict(d1)) | |
#Output:{1: 'a', 2: 'b', 3: 'c', 4: 'd'} |