BbJLeB

04. Transport Price

May 10th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. # 04. Transport Price
  2. n = int(input())
  3. m = input()
  4. taxi_day = 0.79
  5. taxi_night = 0.90
  6. bus = 0.09
  7. train = 0.06
  8. if n <= 19:
  9.     if m == "day":
  10.         taxi_price = 0.70 + (taxi_day * n)
  11.         print(f"{taxi_price:.2f}")
  12.     elif m == "night":
  13.         taxi_price = 0.70 + (taxi_night * n)
  14.         print(f"{taxi_price:.2f}")
  15. if n >= 20 and n <= 99:
  16.     if m == "day" or m == "night":
  17.         bus_price = bus * n
  18.         print(f"{bus_price:.2f}")
  19. if n >= 100:
  20.     if m == "day":
  21.         train_price = train * n
  22.         print(f"{train_price:.2f}")
  23.     elif m == "night":
  24.         train_price = train * n
  25.         print(f"{train_price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment