Introducing If Statements

Now we're going to learn how to tell the computer to make decisions and only run code under certain conditions. For this we will need a new type of value. You've seen numbers and strings, now meet booleans. There are only two boolean values: True and False. Try this program:

condition = True
print(condition)
condition = False
print(condition)

You need to run some code according to the instructions above. In case those aren't clear enough, here's some extra clarification:

  • This step has only one correct answer. You must run exactly the correct code, so check your spelling carefully. Only a few kinds of details (such as spaces in certain places) will be ignored, as they don't make any difference to the program.
  • The exact code that you need to run is shown in the text above, in one piece.

When you run code that doesn't pass the current step, this section will sometimes explain what's wrong.

This step doesn't have any hints. Try reading the instructions and requirements again. You can still check the solution if you're really stuck.


הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>>>