0 votes
1 view
ago in Python by (19.5k points)

Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:

>>> 6/3 

>>> 6//3 

2

1 Answer

0 votes
ago by (46.1k points)

If you are using Python 3.0 then, 5 / 2 will return 2.5 and 5 // 2 will return 2. The former is floating-point division, and the latter is floor division, sometimes also called integer division.

...