FANDOM


If, Elif, and Else are statements in Python.

Syntax Edit

if foo == 5: #Sees if foo is equal to five
    print 'Foo is equal to five!' #If foo is equal to five it prints this
elif foo < 5: #If foo is not equal to five it checks to see if it is less than five
    print 'Foo is less than five!' #If foo is less than five it prints
else: #If foo is not equal to five or less than five it automatically prints
    print 'Foo is greater than five!'