belongs to collection: Function programs in python with examples
Write a Python function to find the Max of three numbers
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
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
I have used python 3.7 compiler for debugging purpose.
Result:
max number among three is:
30
need an explanation for this answer? contact us directly to get an explanation for this answer