Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created July 23, 2020 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/4b5ff3f251d2ce0a5a56254ed3fcb028 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/4b5ff3f251d2ce0a5a56254ed3fcb028 to your computer and use it in GitHub Desktop.
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