?
What will be the output of the following Python function?
What will be the output of the following Python function?
min(max(False,-3,-4), 2,7)
min(max(False,-3,-4), 2,7)
Answer & Solution
Correct Answer:
Option
C
The correct answer is Option C: -3.
Let's break down the expression:
The
So,
Then, the
Thus,
Let's break down the expression:
The
max() function returns the largest of the arguments passed to it.So,
max(False, -3, -4) evaluates to -3 because False is considered as 0.Then, the
min() function returns the smallest of the arguments passed to it.Thus,
min(-3, 2, 7) evaluates to -3, as it's the smallest among the given numbers.
Join the Discussion
Login to post a comment or share your explanation.
Loginsuch a wrong explanation
The correct answer is False
and how can -3 is greater than 0.
what kind of math are you teaching