← Back to Question List
Python Code Walkthrough #41
Two Bumps Of A Counter
📄 Code
Read carefully — what does this print?1class Counter:2 def __init__(self, start: int) -> None:3 self.value: int = start45 def bump(self) -> None:6 self.value = self.value + 178c: Counter = Counter(5)9c.bump()10c.bump()11print(c.value)12print(Counter(0).value)