✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
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
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!