The division in Python is more sophisticated than other languages and has a very complex set of rules. The division in Python has two operators,/and//
First/Division:
In Python 2.x/division is similar to most of the languages we are familiar with, such as Java AH C Ah, the result of dividing an integer is an integer, the fractional part is completely ignored, and the floating-point division retains the part of the decimal point to get the result of a floating-point number.
In Python 3.x/division no longer does this, and the result is a floating-point number for dividing between integers.
Python 2.x:
>>>0>>> 1.0/2.00.5
Python 3.x:
>>> 1/20.5
For//Division, this division, called Floor division, will automatically perform a floor operation on the result of division, consistent in Python 2.x and Python 3.x.
Floor operation: Regardless of the numeric type of the operand, the decimal part is always removed, returning the nearest number in the sequence of numbers that is smaller than the true quotient .
Python 2.x:
>>>-1//2-1
Python 3.x:
>>>-1//2-1
Python Division Operations