Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created Jul 23, 2020
Embed
What would you like to do?
l1=['red','green','blue']
e1=enumerate(l1)
#Returns an enumerate object which is an iterator.
print (e1)#Output:<enumerate object at 0x014894E8>
#Iterating through the iterator using next ()
print (next(e1))#Output:(0, 'red')
#both next() and obj.__next__() do the same.
print (e1.__next__())#Output:(1, 'green')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment