Q. What does the Python code: x = [1, 2, 3]; print(x[::-1]) output?
Solution:
The slice notation [::-1] with a step of -1 reverses the list, so [1, 2, 3] becomes [3, 2, 1].
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.