Home >>Python Built-in Functions >Python divmod() Function
Python divmod() function is employed to return a tuple that contains the value of the quotient and therefore the remainder when dividend is divided by the divisor. It takes two parameters where the first one is the dividend and the second one is the divisor.
Syntax:divmod(dividend, divisor)
Parameter | Description |
---|---|
divident | This parameter contains the number you want to divide. |
divisor | This parameter contains the number you want to divide with. |
x = divmod(9, 2)
print(x)
x = divmod(12, 3)
print(x)