Skip to content

Instantly share code, notes, and snippets.

@vinaykudari
Last active July 21, 2018 18:35
Show Gist options
  • Save vinaykudari/93dcafcb56414a59d8fb960421b18bcd to your computer and use it in GitHub Desktop.
Save vinaykudari/93dcafcb56414a59d8fb960421b18bcd to your computer and use it in GitHub Desktop.
example1
#lis is an iterable
lis = [1,2,3]
#lis_iter is an iterator
lis_iter = iter(lis)
#next() will return consecutive values untill the end
for i in range(len(lis)):
print(next(iterator))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment