✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
If I was to loop over this Iterator, how many times would it iterate?
class NumberIterator: def __init__(self): self.current = 1 def __iter__(self): return self def __next__(self): if self.current == 10: raise StopIteration() next_item = self.current self.current += 2 return next_item
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!