-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsclp014.py
29 lines (24 loc) · 1017 Bytes
/
sclp014.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'''Preço do combustivel'''
litros = float(input('Informe a quantidade de litros que você deseja abastecer: '))
combustivel = (input('Digite \'A\' para Alcool e \'G\' para Gasolina: '))
litros = float(input('Informe a quantidade de litros que você deseja abastecer: '))
combustivel = (input('Digite \'A\' para Alcool e \'G\' para Gasolina: ')).lower().strip()
if combustivel == 'a' or combustivel == 'g':
if combustivel == 'a':
preco= litros * 5.2
if litros <= 20:
preco -= 5.2 * litros * 0.03
print(f'O preço a pagar é R$ {preco:.2f}')
else:
preco -= 5.2 * litros * 0.05
print(f'O preço a pagar é R$ {preco:.2f}')
elif combustivel == 'g':
preco = litros * 6.10
if litros <= 20:
preco -= 6.1 * litros * 0.04
print(f'O preço a pagar é R$ {preco:.2f}')
else:
preco -= 6.1 * litros * 0.06
print(f'O preço a pagar é R$ {preco:.2f}')
else:
print('opção invalida')