Question OOP-CLS-0015
HardWhat is the output of this code?
import copy
class P:
def __init__(self):
self.x = 1
p = P()
q = p
r = copy.copy(p)
q.x = 2
print(p.x, r.x)
- A.
1 1
- B.
2 1
- C.
1 2
- D.
2 2
Sign up free to see the answer and a step-by-step explanation.