WARNING: This program has a bug, which means we need to fix it! This bug is a logic error.

RULE: Any number, letter, or word in quotes is a string!

3 is not equal to "3". An if-statement comparing 3 to "3" will always be False!

  • Click Run 4-5 times until random_choice is equal to 3 and watch the stage to see what's wrong.
  • Debug this program so that when random_choice is 3, the if-statement is True and runs!

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)