uaveiro-leci/1ano/1semestre/fp/aula03/ex07.py

11 lines
204 B
Python
Raw Normal View History

2022-10-11 19:27:51 +00:00
def tax(r):
if r <= 1000:
return 0.1 * r
if r <= 2000:
return 0.2 * r - 100
return 0.3 * r - 300
2022-10-11 19:27:51 +00:00
x = float(input('R? '))
print('O valor de tax(r) é: {:.3f}'.format(tax(x)))