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

What is the output?

print([n * n for n in range(4)][1:3])
  1. [1, 4]
  2. [0, 1]
  3. [4, 9]
  4. [1, 4, 9]
The squares are [0, 1, 4, 9]; the slice [1:3] takes indices 1 and 2.
Play Problem Solving ▸