uaveiro-leci/1ano/fp/aula03/ex05_06.py

19 lines
404 B
Python
Raw Normal View History

2022-10-11 19:27:51 +00:00
def max2(x, y):
if x > y:
return x
else:
return y
def max3(x, y, z):
return max2(x, max2(y, z))
n1 = float(input('Introduza dois valores.\nN1: '))
n2 = float(input('N2: '))
print('\nO maior valor é: ', max2(n1, n2))
n1 = float(input('\n\nIntroduza tres valores.\nN1: '))
n2 = float(input('N2: '))
n3 = float(input('N3: '))
print('\nO maior valor é: ', max3(n1, n2, n3))