Write a function find_max that accepts three numbers as arguments and returns the largest number among three. Write another function main, in main() function accept three numbers from user and call find_max.

Source Code


def find_max(x, y, z):
    if x >= y and x >= z:
        return x
    elif y >= z:
        return y
    else:
        return z

def main():
    a = int(input('Enter the first number: '))
    b = int(input('Enter the second number: '))
    c = int(input('Enter the third number: '))
    largest = find_max(a, b, c)
    print('The largest number is', largest)

main()

      

Output

Enter the first number: 23
Enter the second number: 78
Enter the third number: 34
The largest number is 78