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

What is the output?

print(sorted(['b', 'A', 'a']))
  1. ['A', 'a', 'b']
  2. ['a', 'A', 'b']
  3. ['A', 'b', 'a']
  4. ['a', 'b', 'A']
Sorting compares code points, and every uppercase letter sorts before every lowercase one.
Play Problem Solving ▸