STEP 5: Each function needs a unique, descriptive name!

  • Rename the first function from my_function() to add().
  • Rename the remaining functions subtract(), multiply(), and divide().

We’ll call a function depending on what operation the user chooses. Having pass inside each function allows us to continue coding the rest of the program and even call the functions before we finish writing all the code!

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)