STEP 11: Now that we've returned the damage value, where does it go? We need to store it in a variable!

When calling a function that returns a value, we need to store it in a return variable so that we can use it outside the function. This is done by assigning a variable before a function call using an equals sign.

  • Find the fireball() function and look for this function call: calculate_damage(caster,·"fireball")
  • Add code to this line so that it looks like this: damage = calculate_damage(caster, "fireball")

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)