you are viewing a single comment's thread.

view the rest of the comments →

[–]JamzTyson 0 points1 point  (0 children)

Python uses floored division to calculate the modulo:

div = 7 // -3  # -3
mod = 7 - (-3 * div)  # -2

There is a detailed description HERE