← Back to challenges

Proper Modulo Operator

PythonMediummathnumbers

Instructions

Create a function which returns the Modulo of the two given numbers.

Examples

mod(-13, 64) ➞ 51

mod(50, 25) ➞ 0

mod(-6, 3) ➞ 0

Notes

All test cases contain valid numbers.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Find the Largest Number in a List