When a number (dividend) is divided by another number (divisor), the result consists of two parts:
- Quotient → The whole number result of the division.
- Remainder → The leftover part that cannot be evenly divided.
For 10 ÷ 3:
- Quotient =
10 // 3 = 3 - Remainder =
10 % 3 = 1
In Python, you can find the quotient and remainder using multiple approaches. Here are all the standard ways with examples.
Table of contents
1. Using Quotient Divison (//) and Modulo (%) operators
In Python, you can find the quotient and remainder using the Quotient Divison (//) and Modulo (%) operator, respectively.
Quotient Divison (//): This operator in Python is also called the Floor Division or Integer Division operator. It divides two numbers and returns the integer division, i.e., quotient.
For Example, 13 // 5 = 2 because 13 ÷ 5 equals 2.
Modulo Operator (%): This operator returns the remainder after dividing the first number by the second.
For Example, 13 % 5 = 3 because when 13 is divided by 5, the remainder left is 3.
Code Example
Output:
Quotient: 2
Remainder: 3Code language: Python (python)
2. Using divmod() function
divmod() is a built-in Python function that returns both the quotient and remainder when dividing two numbers. The divmod() function takes two numbers as arguments and returns a tuple containing both the quotient and remainder.
Syntax:- divmod(a, b)
a→ Dividend (the number to be divided).b→ Divisor (the number that dividesa).- Returns a tuple:
(quotient, remainder)
For Example – divmod(13, 5) returns (2, 3), where 2 is the quotient, and 3 is the remainder.
Code Example
3. Using mathematical formula
The mathematical formula to calculate the quotient is:Quotient = Numerator ÷ Denominator
The mathematical formula to calculate the remainder:Remainder = Numerator − ( Quotient × Denominator )
For Example, 13 ÷ 5:
Here, numerator = 13 and denominator = 5
Quotient = Numerator // Denominator = 13 // 5 = 2
Remainder = Numerator − ( Quotient * Denominator ) = 13 - ( 2 * 5 ) = 3

Leave a Reply