top of page

Python Programming Help

Public·2 members

Python program to find highest of three numbers

Create a program, max3.py, that has a function that takes three integer arguments. The

program will then print out the highest of the three values.



def maxValues(first, second, third):

    if first > second:
        
        if second > third:
            print(first,"is the highest number")
            
    else:
        if second > third:
            print(second,"is the highest number")
        else:
            print(third,"is the highest number")


Method called


maxValues(10, 39, 20)
maxValues(10, 20, 30)
maxValues(50, 39, 20)

Output


39 is the highest number
30 is the highest number
50 is the highest number

61 Views
bottom of page