Skip to content

Instantly share code, notes, and snippets.

Created Jul 23, 2020
What would you like to do?
#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