Created
May 16, 2020 20:21
-
-
Save aniruddha27/1b193473295ef29cd7c9f35fd94feeec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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