Exercise 7 

Write a program in Python that asks the user to enter 3 numbers x, y, and z and display their maximum.

Solution

# Ask to type a values of the numbers a, b, c
a = int(input("Type a value of the number a "))
b = int(input("Type a value of the number b "))
c = int(input("Type a value of the number c "))
# define and initialize the maximum number
max = 0
if(a > b):
max = a
else:
max = b
if(max < c):
max = c
else:
max = max
print("The maximum of the three numbers a,b and c is : ", max)
Younes Derfoufi
One thought on “Solution Exercise 7”

Leave a Reply