Maximum of Three Numbers

Write a Python function named max_of_three that takes three integer parameters. The function should return the maximum of the three numbers.

Example 1:

Input: max_of_three(5, 10, 15) 
Output: 15

Example 2:

Input: max_of_three(-5, 0, -10) 
Output: 0

You can use the max function to find the maximum of the three numbers.

def max_of_three(num1, num2, num3):
    return max(num1, num2, num3)

© Let’s Data Science

LOGIN

Unlock AI & Data Science treasures. Log in!