Q. What will be the output of this code?
Code:
a = [1, 2, 3] a[1:2] = [7, 8] print(a)
β
Correct Answer: (A)
[1, 7, 8, 3]
Explanation: Slicing assignment replaces the element at index 1 with two elements.