Python Division Operator

The division operator ‘/ ‘ performs standard division, which can result in a floating-point number. However, if both the dividend and divisor are integers, Python will perform integer division only if the result is an integer. Otherwise, it will produce a floating-point result.

Example

In the above example, we are performing division between two integers, 10 and 3. The result of dividing 10 by 3 is 3.3333333333333335

Python3




# Division operator
 
result = 10 / 3
 
print(result)


Output:

3.3333333333333335

Difference between / vs. // operator in Python

In this article, we will see the difference between the / vs // operator in Python

Similar Reads

Python Division Operator

The division operator ‘/ ‘ performs standard division, which can result in a floating-point number. However, if both the dividend and divisor are integers, Python will perform integer division only if the result is an integer. Otherwise, it will produce a floating-point result....

Floor Division in Python

...

Difference between ‘/’ and ‘//’ in Python Division

The floor division operator // performs division and returns the largest integer that is less than or equal to the division result. It truncates (rounds down) the fractional part of the result, ensuring that the result is always an integer....