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

The break command stops the loop if the program reaches that line of code.

  • First, change the test value from "yes" to rand_num.
  • Then, 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