customiterator

Run Settings
LanguagePython
Language Version
Run Command
class Test: def __init__(self, limit): self.limit = limit def __iter__(self): self.x = 10 return self def __next__(self): x = self.x if x > self.limit: raise StopIteration self.x = x+1 return x for i in Test(2): print(i)
Editor Settings
Theme
Key bindings
Full width
Lines