STEP 18: We've divided the numbers, but what if we want to know the remainder?

  • From drop Remainder indented inside the divide() function.
  • Change the variable name from my_var to remainder. Change the 7 to num_1 and the 3 to num_2.
  • Add Say. Change the string to "The remainder is " + str(remainder).

Modulo (%) is a special math operator that calculates the remainder of the division of two numbers.

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)