ProgrammingHardTCS NQT · Accenture

What is printed?

What is printed?
print(min(['10', '9', '2']), min([10, 9, 2]))
  1. A. 9 2
  2. B. 10 2
  3. C. 2 2
  4. D. 10 9

Correct answer: B. 10 2

Strings compare character by character, so '10' is the smallest string. The integer minimum is 2.

More Python Programming questions

Exams that ask this topic