Skip to content

Files

11_else_if_statements

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 10, 2021
Feb 12, 2021

Else if Statements

Sometimes we might want to extend our decision making when we create if statements. Else if could help us to create more conditions to decide what lines of code to execute

#You can change both those values to test the results of this program
is_snowing = True
is_raining = True
if is_snowing:
    print("It's extremely cold outside")
elif is_raining:
    print("It's not so cold outside")
else:
    print("It's not cold outside")

#If, Elif and Else are associated together.
#It is important to remember that Python will always look to enter one statement in one nested If statement.