What does // do instead of / in division?

Asked by blessing007 · 6 months ago

1 Answer

33
amorebise · 6 months ago Top Answer

The / gives you a decimal (like 5 / 2 = 2.5). The // (floor division) throws away the decimal and gives you the whole number (5 // 2 = 2).

It’s like sharing eggs—you can't share half an egg, so you just count the whole ones. It’s very useful when you need whole numbers only.

Log in to add a comment.