$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #73

What is printed?

a = [1, 2, 3]
print(a[::-1], a[0:0])
  1. [3, 2, 1] []
  2. [1, 2, 3] []
  3. [3, 2, 1] [1]
  4. [3, 2, 1] None
A -1 step reverses the list, and an empty slice yields an empty list.
Play Problem Solving ▸