STEP 16: We need to store and return the damage value from one last function!

  • Just as before, let's return damage! Drag Return Statement inside and at the bottom of cast_spell().
  • Change the variable name from my_var to damage to return this variable for the last time!
  • Look for the cast_spell() function call at the bottom of the program. Place this code in front of it: damage =

Finally the value of damage is outside of all the functions! We can use it now to calculate the wizard's new HP.

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)