ProgrammingHardTCS NQT · Wipro pattern

What is printed?

What is printed?
print(min(3, 2.0, True), max(1, 1.0), max(1.0, 1))
  1. A. 1 1 1.0
  2. B. True 1.0 1
  3. C. True 1 1.0
  4. D. 1 True 1

Correct answer: C. True 1 1.0

True equals 1, and it is the smallest of the three numbers. max() returns the first of equal maxima, so max(1, 1.0) is 1 and max(1.0, 1) is 1.0.

More Python Programming questions

Exams that ask this topic