MemotivaNumbers and arithmetic

How does integer division work in Python 3?

Numbers and arithmetic

Audio flashcard · 0:17

Nortren·

How does integer division work in Python 3?

0:17

Python 3 uses two division operators. The single slash performs true division and always returns a float. The double slash performs floor division and returns the floor of the result, with the type matching the operands. So seven divided by two equals three point five, while seven double-slash two equals three.
docs.python.org