ProgrammingVery hardProduct-company MCQ pattern

What is printed?

What is printed?
print(max(3, 3.0), min(3.0, 3), max([2, 2.0]), type(max(2.0, 2)).__name__)
  1. A. 3.0 3 2 float
  2. B. 3 3.0 2.0 float
  3. C. 3 3.0 2 int
  4. D. 3 3.0 2 float

Correct answer: D. 3 3.0 2 float

max and min return the first item among equal values, so max(3, 3.0) is 3 and min(3.0, 3) is 3.0. max(2.0, 2) returns 2.0, which is a float.

More Python Programming questions

Exams that ask this topic