STEP 9: Let's make our loop stop if the user guessed correctly. To do that we'll use a break statement.

The break keyword tells our program to stop running the loop if it reaches that line of code. The line of code will have a purple and yellow ········ block in front of it to show that it is nested twice.

  • Change the string in .say() to "Great job, you guessed my number!"
  • Go to and drag out Break. Drop it at the bottom of your program, INSIDE the if statement.


# THIS ACTIVITY IS IN PREVIEW ONLY MODE