Web Analytics

Python divmod() Function

Math Function Multi-Return

The divmod() function returns a tuple containing the quotient and the remainder when argument1 (dividend) is divided by argument2 (divisor).

Syntax

divmod(dividend, divisor)

Parameters

Parameter Description
dividend Required. A number
divisor Required. A number

Return Value

A tuple object containing the quotient and the remainder.

Example

Using the divmod() function:

Output
Click Run to execute your code

Related Functions