ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
print(max(1, 2.0, True), min([0.0, -0.0, 0]), sum([]) == 0.0)
  1. A. 2.0 0.0 True
  2. B. 2.0 0.5 True
  3. C. 1 0.0 True
  4. D. 2.0 0.0 False

Correct answer: A. 2.0 0.0 True

max returns 2.0 because it is the largest value. min keeps the first of the equal zeros, which is 0.0, and sum of an empty list is the int 0, which equals 0.0.

More Python Programming questions

Exams that ask this topic