Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- kilometers = float(input())
- part_of_the_day = input()
- taxi_start_tax = 0.70
- taxi_day_tax = 0.79
- taxi_night_tax = 0.90
- buss_tax = 0.09 # само за разстояния минимум 20км
- train_tax = 0.06 # само за разстояния минимум 100км
- # търсим най-ниската цена на транспорт за посочените км
- # цената форматирана до втори знак
- price_for_transport_taxi = 0
- price_for_transport_buss = 0
- price_for_transport_train = 0
- if part_of_the_day == "day":
- price_for_transport_taxi = taxi_start_tax + kilometers * taxi_day_tax
- elif part_of_the_day == "night":
- price_for_transport_taxi = taxi_start_tax + kilometers * taxi_night_tax
- if part_of_the_day == "day" or part_of_the_day == "night":
- price_for_transport_buss = kilometers * buss_tax
- price_for_transport_train = kilometers * train_tax
- if kilometers < 20:
- print(f"{price_for_transport_taxi:.2f}")
- if 20 <= kilometers < 100:
- print(f"{price_for_transport_buss:.2f}")
- if kilometers >= 100:
- print(f"{price_for_transport_train:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment