Q:

Write a Python function to find the Max of three numbers

0

Write a Python function to find the Max of three numbers

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

I have used python 3.7 compiler for debugging purpose.

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 number among three is:")
print(max_of_three(10, 30, 20))

Result:

max number among three is:

30

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a Python function to sum all the numbers in ... >>