Advertisement
D1mitroV

Transport Price - Answer

Mar 29th, 2021
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. distance = int(input())
  2. day_or_night = input()
  3. price = 0.00
  4.  
  5. if day_or_night == "day":
  6.     taxi_rate = 0.79
  7. else:
  8.     taxi_rate = 0.90
  9.  
  10. if distance < 20:
  11.     price = 0.70 + taxi_rate * distance
  12.  
  13. if distance >= 20 and distance <= 100:
  14.     price = distance * 0.09
  15.  
  16. if distance >= 100:
  17.     price = distance * 0.06
  18.  
  19.  
  20. print("%.2f" % price)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement