Let’s look at the statement given below in Python 2.7 for Data Science.
The first result is ok, but the second one can be confusing to people who already have done C++ or Java. We should remember that in Python 2.7, “/” operator acts as a floor division for integer arguments. But if we want to obtain a float value, then one of the arguments should be a float.
“//” is the real floor division operator. Whether you enter an integer or a floating-point as an argument it returns floor value.
In Python 3 “/” operator returns floats in case of both integer and float as arguments.