Now let's check the player's guess against the actual word.

  • Go to and drag if else inside the loop.
  • Change the word in front of both .say() commands to announcer.
  • Use the if statement to check if my_var is equal to word.
  • Create a message like, "You got it!" and another message under else like "Try again."

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)