Really great work! Here's what you've learned in this unit:
- Basics of control flow;
- Comparators (such as
>,<, and==); - Boolean operators (
and,or, andnot); - And conditional statements (
if,else, andelif).
Let's get to the grand finale.
Write an if statement in the_flying_circus(). It must include:
and,or, ornot;==,!=,<,<=,>, or>=;- an
if,elif, ANDelsestatement; - it must
return Truewhen evaluated.
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!