Advertisement
mbstanchev

fuel_tank

Jan 27th, 2022
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. type_of_fuel = input()
  2. fuel_in_tank = float(input())
  3. fuel = ""
  4.  
  5. if type_of_fuel != "Diesel" and type_of_fuel != "Gasoline" and type_of_fuel != "Gas":
  6. print(f"Invalid fuel!")
  7. else:
  8. if fuel_in_tank >= 25:
  9. if type_of_fuel == "Diesel":
  10. fuel = "diesel"
  11. elif type_of_fuel == "Gasoline":
  12. fuel = "gasoline"
  13. elif type_of_fuel == "Gas":
  14. fuel = "gas"
  15. print(f"You have enough {fuel}.")
  16. else:
  17. if type_of_fuel == "Diesel":
  18. fuel = "diesel"
  19. elif type_of_fuel == "Gasoline":
  20. fuel = "gasoline"
  21. elif type_of_fuel == "Gas":
  22. fuel = "gas"
  23. print(f"Fill your tank with {fuel}!")
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement