ProgrammingVery hardProduct-company MCQ pattern

What is printed?

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

Correct answer: D. 1.0 1 True 1.0

True, 1 and 1.0 compare equal, and min and max return the first element that wins a tie. So max([1, True, 1.0]) is the first 1, and min([1.0, True]) keeps 1.0.

More Python Programming questions

Exams that ask this topic