The Modulo Operation (%) With Negative Numbers in Python
Have you ever wondered how it works?
Published in
4 min readSep 28, 2020
This is something I learned recently and thought was worth sharing given that it quite surprised me and it’s a super-useful fact to learn. How does Python handle the modulo operation with negative numbers? So, let’s keep it short and sweet and get straight to it.
“The
%
symbol in…