jeudi 16 septembre 2021

What is wrong with the if-statements in this source-code? [duplicate]

fuel = input()
liters = float(input())

if liters >= 25:
    if fuel == "diesel" or "gasolin" or "gas":
        print(f"You have enough {fuel}.")
    else:
        print("Invalid fuel!") # Why that not work

elif liters < 25:
    if fuel == "diesel" or "gasolin" or "gas":
        print(f"Fill your tank with {fuel}!")
    else:
        print("Invalid fuel!") # Why that not work

else:
    print("Invalid fuel!") # Why that not work

Aucun commentaire:

Enregistrer un commentaire