The else statement complements the if statement. An if/else pair says: “If this expression is true, run this indented code block; otherwise, run this code after the else statement.”

Unlike if, else doesn’t depend on an expression. For example:

if 8 > 9: print "I don't get printed!" else: print "I get printed!"



Complete the else statements to the right. Note the indentation for each line!

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?