Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 04. Transport Price
- n = int(input())
- m = input()
- taxi_day = 0.79
- taxi_night = 0.90
- bus = 0.09
- train = 0.06
- if n <= 19:
- if m == "day":
- taxi_price = 0.70 + (taxi_day * n)
- print(f"{taxi_price:.2f}")
- elif m == "night":
- taxi_price = 0.70 + (taxi_night * n)
- print(f"{taxi_price:.2f}")
- if n >= 20 and n <= 99:
- if m == "day" or m == "night":
- bus_price = bus * n
- print(f"{bus_price:.2f}")
- if n >= 100:
- if m == "day":
- train_price = train * n
- print(f"{train_price:.2f}")
- elif m == "night":
- train_price = train * n
- print(f"{train_price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment