Find the division remainder of a number Find the division remainder of a number python python

Find the division remainder of a number


you are looking for the modulo operator:

a % b

for example:

26 % 7

Of course, maybe they wanted you to implement it yourself, which wouldn't be too difficult either.


The remainder of a division can be discovered using the operator %:

>>> 26%75

In case you need both the quotient and the modulo, there's the builtin divmod function:

>>> seconds= 137>>> minutes, seconds= divmod(seconds, 60)


26 % 7 (you will get remainder)

26 / 7 (you will get divisor can be float value )

26 // 7 (you will get divisor only integer value) )