WARNING: This program has a bug, which means we need to fix it! We want the sprite to say the return value.

RULE: Variables created INSIDE a function can only be used INSIDE that same function unless the function returns a value. For this example, the return variable, my_answer, holds the return value, product.

  • Click Run and read the error message to debug the program.
  • Debug the program so that the sprite says the value returned by the function.

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)