floor division

Division with the // operator, which rounds the answer down to the next whole number: 7 // 2 is 3.

In more detail

Together with the remainder operator it splits a division into quotient and remainder, as in long division. It rounds towards minus infinity, so -7 // 2 is -4, not -3. With a float operand the result is a whole-valued float, such as 3.0.

Example

7 // 2, 7 % 2   # (3, 1)

Related terms

Taught in

References

Certification courses