Python divmod() Function
Example
Display the quotient and the remainder of 5 divided by 2:
x = divmod(5, 2)
Try it Yourself »
Definition and Usage
The divmod() function returns a tuple
containing the quotient and the remainder when argument1 (divident) is
divided by argument2 (divisor).
Syntax
divmod(divident, divisor)
Parameter Values
| Parameter | Description |
|---|---|
| divident | A Number. The number you want to divide |
| divisor | A Number. The number you want to divide with |


