Skip to Content

Python’s double slash operator enables the user to mathematically calculate the equivalent of whole division ignoring any remainder.

For example, here is a demonstration in the Python REPL:

>>> 31 // 2
15

Notice the answer isn’t 15.5 which would be the complete answer when applying normal division.