नीचे दिए गए प्रोग्राम का आउटपुट क्या है?
What is the output of below program ?
def maximum(x, y):
if x > y:
return x
elif x == y:
return 'The numbers are equal'
else:
return y
print(maximum(2, 3))
A)
B)
C)
D)
Explanation:
The function maximum(x, y)
compares two values x
and y
.
- If
x > y
, it returnsx
. - If
x == y
, it returns the string'The numbers are equal'
. - Otherwise, it returns
y
.
In this case, we call maximum(2, 3)
:
2
is less than3
, so the function will return3
.
Hence, the output will be (B) 3