answersLogoWhite

0

What is floor division in Python?

Updated: 12/17/2022
User Avatar

DaKrazyJak

Lvl 1
12y ago

Best Answer

Floor division is division where the answer is rounded down. For example, 5/2 in floor division is not 2.5, but 2. In Python 2, floor division is the default. In Python 3, the floor division operator is //.

Python 2:

>>> 5/2

2

>>> 5.0/2

2.5

Python 3:

>>> 5/2

2.5

>>> 5//2

2

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is floor division in Python?
Write your answer...
Submit
Still have questions?
magnify glass
imp