class Counter:
def __init__(self, start, stop):
self.current = start
self.stop = stop
def __iter__(self):
return self
def __next__(self):
if self.current >= self.stop:
raise StopIteration
result = self.current
self.current += 1
return result
c = Counter(3, 5)
print(list(c))
print(list(c))
Post #2945
645
Что выведет код?