Floor Division

noun

say it: “FLOR dih-VIZH-un” /ˈflɔr dɪˈvɪʒən/

Dividing with // and dropping anything after the decimal point, so 17 // 5 is 3.

What is floor division?

Floor division (//) divides and throws away anything after the decimal point, leaving a whole number.

cookies = 17
kids = 5
print(cookies // kids)  # 3 cookies each

In a sentence

  • “Floor division gives each kid 3 cookies.”
  • “125 // 60 uses floor division to get the whole hours in 125 minutes.”

Level: Novice · More Python terms at this level

Updated