DEMO 1: Let's see how we can write programs that change depending on random numbers!

If statements, or conditionals, start with a test that compares a test variable to a test value. If the test statement is true, the code indented underneath runs. If the test statement is not true, the indented code is skipped and the rest of the program runs. An indent is 4 spaces, and properly indented lines will show a ···· before the line of code!

  • Click Run and follow the on-stage instructions before clicking Submit and Next to move on.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE