Codecademy

Sign In Create Account
01/01
The Big If

Really great work! Here's what you've learned in this unit:

  1. Basics of control flow;
  2. Comparators (such as >, <, and ==);
  3. Boolean operators (and, or, and not);
  4. And conditional statements (if, else, and elif).

Let's get to the grand finale.

Write an if statement in the_flying_circus(). It must include:

  1. and, or, or not;
  2. ==, !=, <, <=, >, or >=;
  3. an if, elif, AND else statement;
  4. it must return True when evaluated.
Stuck? Get a hint!Hint

Be careful with your indentation—the_flying_circus() is a function (which we'll get to in the next unit), and as you can see from the comment, function blocks are indented the same way if, elif, and else blocks are.

Your code should look something like this:

def the_flying_circus():
    if condition:
        # Do something!
    elif condition:
        # Do something else!
    else:
        # Do yet another thing!
Save & Submit Code Reset Code
Back to editor

Start Here

Each lesson starts here. Read the explanation, then follow the instructions underneath. If you get stuck, you can click on the "Hint" for help.

Enter your Code

Type your response to the instructions here, in your code editor.

Submit!

Ready to see if your code does what it should? Click "Save + Submit" to run and check your code!

Click "Save + Submit" to run your code! Your code’s output will pop up on the screen.

See What it Does

This is the terminal. When you submit your code, it will run your code and display the result here.

Sign in to Codecademy