STEP 12: If the user guesses the wrong word, we will tell them to try again and then run through the loop again.

  • Go to and drag out if. It should only be indented once - in the loop!
  • Change the test variable from choice to guess and the test value from "yes" to password.
  • Change the == sign to !=. In Python, the comparison operator != means does not equal.
  • In GRAPHICS, click and drop Say inside the if statement. It will be indented 8 spaces total!

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)