Question OOP-CLS-0035
EasyWhat is the output of this code?
class Counter:
def __init__(self):
self.n = 0
def inc(self):
self.n += 1
c = Counter()
c.inc()
c.inc()
print(c.n)
- A.
2
- B.
1
- C.
Sign up free to see the answer and a step-by-step explanation.