STEP 12: Let's tell the user if their guess was too high. First we need to test if guess is greater than rand_num.

  • From drag out elif and drop it inside the for loop so that it only has a ···· in front of it.
  • Change the test variable from choice to guess and the test value from "yes" to rand_num.
  • Replace == with >. Just like in math, this tests if the test variable is greater than the test value.
  • Go to GRAPHICS and . Drag Say indented twice in the if-statement. Assign it to computer.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)