Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created May 16, 2020 20:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save aniruddha27/1b193473295ef29cd7c9f35fd94feeec to your computer and use it in GitHub Desktop.
class Sequence():
def __init__(self):
self.num = 2
def __iter__(self):
return self
def __next__(self):
val = self.num
self.num += 2
return val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment