Sub topic 3
Division with remainder: n = dq + r
This chapter assumes you know integers (including negatives and zero), factors and multiples, long division, and exponent notation.
Division with remainder
For any integer n and positive integer d, there are unique integers q and r with n = dq + r and 0 <= r < d. Here q is the quotient and r is the remainder. Python's divmod returns both values.
print(divmod(47, 5)) # (9, 2): 47 = 5*9 + 2
print(divmod(-7, 5)) # (-2, 3): -7 = 5*(-2) + 3100%