Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k 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 (106k 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
asked Feb 18, 2021 in Python by laddulakshana (16.4k points)
0 votes
0 answers
asked Feb 17, 2021 in Java by Harsh (1.5k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...