Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python divmod() function is used to return quotient and remainder of a division operation. It requires two parameter, first for dividend and second for divisor and returns values in a tuple form containing quotient and remainder.

Syntax

divmod(dividend, divisor)

Parameters

dividend Required. A number which need to be divided.
divisor Required. A number with which a dividend need to be divided.

Example:

In the below example, divmod() function is used to find out the quotient and remainder of a given division operation.

a = 83
b = 10
print(divmod(a, b))

The output of the above code will be:

(8, 3)

❮ Python Built-in Functions