13

Anonymous
plain_text
09/28/2022 8:47 PM
404 B
19
Indexable
class CustomerCounter:
  
  def __iter__(self):
    self.count = 0
    return self

  def __next__(self):
    self.count +=1

    if self.count > 5:
      raise StopIteration
    return self.count


customer_counter = CustomerCounter()


for customer_count in customer_counter:
  print(customer_count)
Editor is loading...