Advertisement
bl00dt3ars

08. Fuel Tank - Part 2

Nov 9th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. type_of_fuel = input()
  2. amount_of_fuel = float(input())
  3. club_card = input()
  4.  
  5. if club_card == "Yes":
  6.   gas = 0.93 - 0.08
  7.   gasoline = 2.22 - 0.18
  8.   diesel = 2.33 - 0.12
  9. else:
  10.   gas = 0.93
  11.   gasoline = 2.22
  12.   diesel = 2.33
  13.  
  14. if type_of_fuel == "Gas":
  15.   total_price = gas * amount_of_fuel
  16. elif type_of_fuel == "Gasoline":
  17.   total_price = gasoline * amount_of_fuel
  18. else:
  19.   total_price = diesel * amount_of_fuel
  20.  
  21. if amount_of_fuel > 25:
  22.   total_price *= 0.9
  23. elif 20 <= amount_of_fuel <= 25:
  24.   total_price *= 0.92
  25.  
  26. print(f"{total_price:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement