File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1+ #Travel Cost
12#31- Develop a program that asks the distance of a trip in km. Calculate the ticket price, charging R$0.50 per
23# km for trips up to 200km and R$0.45 for longer trips.
34distance = float (input ('What is the distance of your travel?' ))
78else :
89 price = distance * 0.45
910print (f'And the price of your ticket will be R${ price } .' )
11+
12+ #Custo da Viagem
13+ # 031: Desenvolva um programa que pergunte a distância de uma viagem em Km. Calcule o preço da passagem,
14+ # cobrando R$0,50 por Km para viagens de até 200Km e R$0,45 parta viagens mais longas.
15+ distancia = float (input ('Qual a distância em Km que você vai viajar?' ))
16+ if distancia <= 200 :
17+ preco = distancia * 0.50
18+ else :
19+ preco = distancia * 0.45
20+ print (f'O preço da passagem será de R${ preco :.2f} .' )
21+
22+ #PT- Exercícios com uso de condicional.
23+ #EN- Exercises using conditional.
You can’t perform that action at this time.
0 commit comments