ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print(max('7', '10'), max(7, 10), min('7', '10'), '7' > '10')
  1. A. 10 10 7 False
  2. B. 7 10 10 True
  3. C. 7 10 7 True
  4. D. 7 10 10 False

Correct answer: B. 7 10 10 True

Strings compare character by character, so '7' is greater than '10'. As ints, 10 is larger, and min of the strings is '10'.

More Python Programming questions

Exams that ask this topic