WARNING: This program has a syntax error! It tries to use a variable that should be included as a return variable.

We use a return variable to store information that was returned from inside a function.

  • Click Run and read the error message. The variable new_grade is undefined!
  • We see that the function calculate_grade() has a return statement, but is it stored in a return variable?
  • Fix this program by storing the result of calculate_grade() in the return variable new_grade.

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)