STEP 11: We need a way of telling the computer that the player has won.

  • Remember our boolean variable named correct_answer? Let's use it to see if a user guessed correctly.
  • In LOGIC, click on and drag in Boolean Variable INSIDE your if statement.
  • Change the variable my_var to correct_answer.

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)