0 votes
1 view
in Python by (47.8k 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
by (107k points)
edited by

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.

To know more about this you can have a look at the following video tutorial:-

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...