ivantanchev

fuel_two

Mar 10th, 2022 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.76 KB | None | 0 0
  1.  
  2. fuel_type = str(input())
  3. fuel_quantity = int(input())
  4. club_card = str(input())
  5.  
  6. gas_price = 0.93
  7. diesel_price = 2.33
  8. gasoline_price = 2.22
  9.  
  10. if fuel_type == "Gas" and club_card == "Yes":
  11.     if  fuel_quantity < 20:
  12.         sum = (gas_price - 0.08) * fuel_quantity
  13.         print(f"{sum:.2f} lv.")
  14.     elif fuel_quantity <= 25:
  15.         sum = (gas_price - 0.08) * fuel_quantity
  16.         total = sum * 0.92
  17.         print(f"{total:.2f} lv.")
  18.     elif fuel_quantity > 25:
  19.         sum = (gas_price - 0.08) * fuel_quantity
  20.         total = sum * 0.90
  21.         print(f"{total:.2f} lv.")
  22. elif fuel_type == "Gas" and club_card == "No":
  23.     if    fuel_quantity < 20:
  24.         sum = gas_price  * fuel_quantity
  25.         print(f"{sum:.2f} lv.")
  26.     elif fuel_quantity <= 25:
  27.         sum = gas_price * fuel_quantity
  28.         total = sum * 0.92
  29.         print(f"{total:.2f} lv.")
  30.     elif fuel_quantity > 25:
  31.         sum = gas_price  * fuel_quantity
  32.         total = sum * 0.90
  33.         print(f"{total:.2f} lv.")
  34. elif fuel_type == "Gasoline" and club_card == "Yes":
  35.     if   fuel_quantity < 20:
  36.         sum = (gasoline_price - 0.18) * fuel_quantity
  37.         print(f"{sum:.2f} lv.")
  38.     elif fuel_quantity <= 25:
  39.         sum = (gasoline_price - 0.18) * fuel_quantity
  40.         total = sum * 0.92
  41.         print(f"{total:.2f} lv.")
  42.     elif fuel_quantity > 25:
  43.         sum = (gasoline_price - 0.18) * fuel_quantity
  44.         total = sum * 0.90
  45.         print(f"{total:.2f} lv.")
  46. elif fuel_type == "Gasoline" and club_card == "No":
  47.     if fuel_quantity < 20:
  48.         sum = gasoline_price * fuel_quantity
  49.         print(f"{sum:.2f} lv.")
  50.     elif fuel_quantity <= 25:
  51.         sum = gasoline_price * fuel_quantity
  52.         total = sum * 0.92
  53.         print(f"{total:.2f} lv.")
  54.     elif fuel_quantity > 25:
  55.         sum = gasoline_price * fuel_quantity
  56.         total = sum * 0.90
  57.         print(f"{total:.2f} lv.")
  58. elif fuel_type == "Diesel" and club_card == "Yes":
  59.     if   fuel_quantity < 20:
  60.         sum = (diesel_price - 0.12) * fuel_quantity
  61.         print(f"{sum:.2f} lv.")
  62.     elif fuel_quantity <= 25:
  63.         sum = (diesel_price - 0.12) * fuel_quantity
  64.         total = sum * 0.92
  65.         print(f"{total:.2f} lv.")
  66.     elif fuel_quantity > 25:
  67.         sum = (diesel_price - 0.12) * fuel_quantity
  68.         total = sum * 0.90
  69.         print(f"{total:.2f} lv.")
  70. elif fuel_type == "Diesel" and club_card == "No":
  71.     if fuel_quantity < 20:
  72.         sum = diesel_price * fuel_quantity
  73.         print(f"{sum:.2f} lv.")
  74.     elif fuel_quantity <= 25:
  75.         sum = diesel_price * fuel_quantity
  76.         total = sum * 0.92
  77.         print(f"{total:.2f} lv.")
  78.     elif fuel_quantity > 25:
  79.         sum = diesel_price * fuel_quantity
  80.         total = sum * 0.90
  81.         print(f"{total:.2f} lv.")
  82.  
  83.  
  84.  
Add Comment
Please, Sign In to add comment