Type=str(input("what type of fuel does your car require? "))
amount=float(input("how much fuel have you put into your car in litres? "))
if Type==“petrol” or “Petrol”:
total=1.40amount
elif Type==“diesel” or “Diesel”:
total=1.55amount
elif Type==“lpg” or “LPG” or “Lpg”:
total=0.95amount
given=float(input("how much money have you given? "))
change=given-total
print(“you are owed £”,change,“change”)
loyalty=str(input("do you have a loyalty card? "))
if loyalty==“yes” or “Yes”:
whole=math.floor(total)
full=math.floor(amount)
points=whole + full
if points>100:
points2=points1.1
else:
points2=points
print(“you have gained”,points2,“points”);
You don’t need the str ‘Type’ here, because the input() function returns a string by default; the same goes for the other inputs, where a user is entering a string at said input.
Also, be mindful of your variable names – Type could be confusing; better to use the likes of fuel_type, in this instance.
@abessman has offered a nice way to do this, but you could also use:
if fuel_type == "petrol" or fuel_type == "Petrol":