Built-in Functions
divmod()
Get a quotient and remainder together.
divmod(a, b)
divmod() divides one number by another and returns two results at once: the whole-number quotient and the remainder.
Parameters
| Name | Description |
|---|---|
| a | The number to divide. |
| b | The number to divide by. |
Returns
A two-item tuple: (quotient, remainder).
Try it
Run it and change it
quotient, remainder = divmod(17, 5) print(quotient, remainder)