Question OOP-CLS-0041
MediumWhat is the output of this code?
class Counter:
count = 0
def __init__(self):
Counter.count += 1
self.id = Counter.count
a = Counter(); b = Counter(); c = Counter()
print(a.id, c.id, Counter.count)
- A.
1 3 3
- B.
3 3 3
- C.
0 2 3
- D.
1 1 3
Sign up free to see the answer and a step-by-step explanation.