Python: The divmod() function
The [built-in]
divmod()
function returns a tuple containing the quotient and the remainder when argument1 (dividend) is divided by argument2 (divisor).
For example:
>>> x = divmod(5, 2)
>>> print(x)
(2, 1)
Via w3schools.com.
Leave a comment