Ddimov90

fuel_tank_part_two_08_03

Sep 23rd, 2025
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | Source Code | 0 0
  1. fuel_type = input()
  2. liters = float(input())
  3. card = input()
  4.  
  5. price = 0
  6.  
  7. if card == "No":
  8.     if fuel_type == "Gasoline":
  9.         price = 2.22 * liters
  10.     elif fuel_type == "Diesel":
  11.         price = 2.33 * liters
  12.     else:
  13.         price = 0.93 * liters
  14.  
  15. else:
  16.     if fuel_type == "Gasoline":
  17.         price = (2.22 - 0.18) * liters
  18.     elif fuel_type == "Diesel":
  19.         price = (2.33 - 0.12) * liters
  20.     else:
  21.         price = (0.93 - 0.08) * liters
  22.  
  23. if 20 <= liters <= 25:
  24.     price -= price * 0.08
  25.  
  26. if liters > 25:
  27.     price -= price * 0.1
  28.  
  29.  
  30. print(f"{price:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment