Last active
May 7, 2016 15:06
-
-
Save rahulkp220/24a0afc1ac38936b8d6d303144e614be 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 mimic_range: | |
def __init__(self,maximum): | |
self.maximum = maximum | |
def __iter__(self): | |
self.current = 0 | |
return self | |
def next(self): | |
num = self.current | |
if self.current >= self.maximum: | |
raise StopIteration | |
self.current += 1 | |
return num |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment