Javatpoint Logo
Javatpoint Logo

Python divmod() Function

Python divmod() function is used to get remainder and quotient of two numbers. This function takes two numeric arguments and returns a tuple. Both arguments are required and numeric. This function has the following syntax.



number1: A numeric value, it is required.

number2: A numeric value, it is required.


It returns a tuple.

Let's see some examples of divmod() function to understand it's functionality.

Python divmod() Function Example 1

Let's see a simple example to call divmod() function.


(5, 0)

Python divmod() Function Example 2

It also allows passing float values as an argument. See an example below.


(2.0, 0.5)

Python divmod() Function Example 3

Here, we are passing the first argument as integer and second as a float value.


(2.0, 1.5)

Next TopicPython Functions

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA