Q. What will be the output of this code?
Code:
a = [1, 2, 3] print(a[::-1])
β
Correct Answer: (B)
[3, 2, 1]
Explanation: Slicing with -1 reverses the list.