Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:
>>> 6/3
2
>>> 6//3
2
//
is floor division, it will always give you the floor value of the result./
is the floating-point division.Followings are the difference between /
and //
;
I have run these arithmetic operations in Python 3.7.2
>>> print (11 / 3)
3.6666666666666665
>>> print (11 // 3)
3
>>> print (11.3 / 3)
3.7666666666666667
>>> print (11.3 // 3)
3.0