"""Functions for exact integer division.""" from operator import floordiv, mod def divide_exact(n, d): """Return the quotient and remainder of dividing n by d. >>> q, r = divide_exact(13, 5) >>> q 2 >>> r 3 """ return floordiv(n, d), mod(n, d)