Python Classes with methods [closed]

Try to initialize instance variable counter to 0 in init method:

def __init__(self):
    self.counter = 0

Rest of the code is ok.

Browse More Popular Posts

Leave a Comment