STEP 1: Instead of asking for input inside EACH function, let's ask for input ONCE before the functions.

  • From drop two Ask for Float after asking for the math operation and before the conditionals.
  • Change the strings in both .ask() commands to "Enter a number."
  • Change the first variable name from guess to num_1 and the second variable name to num_2.

Now that we have the two numbers before the conditionals, we can pass both numbers into any of the functions.

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)