ProgrammingHardTCS NQT · Infosys

What is printed?

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

Correct answer: B. 9 10 9

As strings, '9' is the largest because it comes after '2' and '10'. As integers, 10 is largest, and the smallest of 10 and 9 is 9.

More Python Programming questions

Exams that ask this topic