Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created Jul 23, 2020
Embed
What would you like to do?
l1=[1,2,3]
l2=['a','b','c'
#zip() returns an iterator
z=zip(l1,l2)
print (z)#Output:<zip object at 0x02DB94E8>
#Accessing elements in the iterator using next() function.
print (next(z))#Output:(1, 'a')
print (next(z))#Output:(2, 'b')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment