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 two values. If the test statement is true, the code indented underneath runs. If the test statement is not true, the block of code underneath is skipped and the rest of the program runs.

  • Click Run and view the example on the stage. Watch the program see different outcomes!
  • Watch the demo three times before you click Submit and Next to move on.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE