python-CSD-kursu/python-temel/next.method.py

6 lines
126 B
Python
Raw Normal View History

2023-09-02 13:12:30 +03:00
def __next__(self):
if self.count == self.stop:
raise StopIteration
self.count += 1
return self.count - 1