Q. Write a Python function to find the maximum of three numbers.
Answer =
def max_of_two (x, y): if x > y : return x return y def max_of_three (x, y, z): return max_of_two (x, max_of_two(y, z)) print (max_of_three (8, -4, 10))
Output:-
10
>>>
Answer =
def max_of_two (x, y): if x > y : return x return y def max_of_three (x, y, z): return max_of_two (x, max_of_two(y, z)) print (max_of_three (8, -4, 10))
Output:-
10
>>>
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )