नीचे दिए गए प्रोग्राम का आउटपुट क्या है?
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
2
B
3
C
The numbers are equal
D
None of the options
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):
2is less than3, so the function will return3.
Hence, the output will be (B) 3
Correct Answer: B) 3