Python – How to calculate a mod b in Python

python

Is there a modulo function in the Python math library?

Isn't 15 % 4, 3? But 15 mod 4 is 1, right?

Best Answer

There's the % sign. It's not just for the remainder, it is the modulo operation.