Net WPM0
WPM0
Accuracy100%
Elapsed0s
Time—
Characters0
Incorrect0
Errors0
Progress0%
Read code prompt guide
Programming Language
Python
Difficulty
Medium

Define a class with state and an increment method.

class Counter:
    def __init__(self, start=0):
        self.value = start

    def increment(self):
        self.value += 1
        return self.value


counter = Counter(3)