ExamVeda
Login
Home
Introduction to Python
?

What will be the output of the following Python function?
min(max(False,-3,-4), 2,7)

Answer & Solution
Correct Answer: Option D
In Python, the boolean value False evaluates to 0 in numeric contexts.
The max() function returns the largest of the given arguments.
Here, we have the expression max(False, -3, -4).
Since False is equivalent to 0, and -3 and -4 are numeric values, the largest value among them is 0.
Therefore, the output of max(False, -3, -4) is False.
The min() function then evaluates min(False, 2, 7), and since False evaluates to 0 and 2 and 7 are greater than 0, the minimum value among them is False.
Hence, the overall output is False.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.