Is there a modulo function in the python math library?
Isn't 15 % 4, 3? But 15 mod 4 is 1, right?
15 % 4
15 mod 4
There's the % sign. It's not just for the remainder, it is the modulo operation.
you can also try divmod(x, y) which returns a tuple (x // y, x % y)
(x // y, x % y)