Q. What is the output of the following code?
Code:
x = [1, 2, 3] print(x * 2)
β
Correct Answer: (A)
[1, 2, 3, 1, 2, 3]
Explanation: Multiplying a list replicates its elements. So [1,2,3] * 2 creates [1,2,3,1,2,3].