STEP 11: Let's finish the subtract() function!

  • From drop Subtraction indented inside the subtract() function.
  • Change the variable name from my_var to result. Change the 5 to num_1 and the 1 to num_2.
  • Add Say. Change the string to "The result is " + str(result).

To concatenate a number and a string, we must cast the number to a string using str().

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)