ProgrammingModerateTCS NQT · Infosys

What is printed?

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

Correct answer: C. 17 3 9

Converted to numbers, 17 is the largest and 3 the smallest. Sorted as strings, '17' comes before '3' and '9', so the last string is '9'.

More Python Programming questions

Exams that ask this topic