python if else if else code example
Example 1: if syntax in python
variable_name = input("y/n? >> ")
if variable_name == "y":
print("That's good! :) ")
elif variable_name == "n":
print("That's bad! :( ")
else:
print("You blow up for not following my instructions. Detention forever and get lost!")
Example 2: else if python
if (condion):
result
elif (condition):
results
else:
result
Example 3: Python If ... Else
a = 33
b = 33
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")