if elif else
Objective
Introductory Problem
if elif else

Difference between if and if elif else
Example 1
Last updated
Was this helpful?

Last updated
Was this helpful?
Was this helpful?
gas = input("What type of gas do you want? ")
if gas == "regular":
print("Regular Gas:",3.89*17)
elif gas == "plus":
print("Plus Gas:",4.09*17)
elif gas == "premium":
print("Premium Gas:",4.19*17)
elif gas == "diesel":
print("Diesel Gas:",4.59*17)
else:
print("Invalid Gas Type")