← Back to challenges

Return the Remainder from Two Numbers

PythonEasymathnumbers

Instructions

There is a single operator in Python, capable of providing the remainder of a division operation. Two numbers are passed as parameters. The first parameter divided by the second parameter will have a remainder, possibly zero. Return that value.

Examples

remainder(1, 3) ➞ 1

remainder(3, 4) ➞ 3

remainder(5, 5) ➞ 0

remainder(7, 2) ➞ 1

Notes

  • The tests only use positive integers.
  • Don't forget to return the result.
  • If you get stuck on a challenge, find help in the Resources tab.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Return a String as an Integer