Question OOP-CTOR-0046
MediumWhat is the output of this code?
class A:
def __init__(self, x=[]):
x.append(1)
self.x = x
a = A(); b = A()
print(len(b.x))
- A.
2
- B.
Error
- C.
Sign up free to see the answer and a step-by-step explanation.