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,4,5]
l2=reversed(l1)
#Returns an iterator
print (l2)#Output:<list_reverseiterator object at 0x0111E4D8>
print (next(l2))#Output:5
print (next(l2))#Output:4
print (next(l2))#Output:3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment