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

What is the output?

print(min([3, -5, 2], key=abs))
  1. 2
  2. -5
  3. 3
  4. 5
The key compares absolute values (3, 5, 2), but min returns the original element.
Play Problem Solving ▸