Q. What will this code print?
Code:
a = [1, 2, 3] b = a[:] a.append(4) print(b)
β
Correct Answer: (B)
[1, 2, 3]
Explanation: Using slicing (`[:]`) creates a shallow copy of the list.