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

What is printed?

print(sorted([3, 1, 2], reverse=True), [3, 1, 2].sort())
  1. [3, 2, 1] None
  2. [3, 2, 1] [1, 2, 3]
  3. [1, 2, 3] None
  4. [3, 2, 1] [3, 2, 1]
sorted returns a new list; list.sort() sorts in place and returns None.
Play Problem Solving ▸