Question:medium

What will be the output of the following Python code?
a = [1, 2, 3]
print(a[::-1])

Show Hint

The slice [::-1] is the "Pythonic" way to reverse a list or string. It’s concise, fast, and very common in coding interviews!
Updated On: May 11, 2026
  • [1, 2, 3]
  • [3, 2, 1]
  • Error
  • None
Show Solution

The Correct Option is B

Solution and Explanation

Was this answer helpful?
0


Questions Asked in CUET (UG) exam