Advertisement
mbstanchev

Untitled

Jan 18th, 2022
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. nub_of_km = int(input())
  2. day_night = input()
  3. price = 0
  4.  
  5. if day_night == "day":
  6.  
  7. if nub_of_km >= 100:
  8. price = 0.06 * nub_of_km
  9.  
  10. elif nub_of_km >= 20:
  11. price = 0.09 * nub_of_km
  12. else:
  13. price = 0.7 + 0.79 * nub_of_km
  14.  
  15. elif day_night == "night":
  16.  
  17. if nub_of_km >= 100:
  18. price = 0.06 * nub_of_km
  19.  
  20. elif nub_of_km >= 20:
  21. price = 0.09 * nub_of_km
  22. else:
  23. price = 0.7 + 0.9 * nub_of_km
  24.  
  25. print(f"{price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement