Q. What will be the output of this code?
Code:
x = [1, 2, 3] y = x x.append(4) print(y)
β
Correct Answer: (B)
[1, 2, 3, 4]
Explanation: Both x and y reference the same list object, so changes via x reflect in y.