2 Respostas
+ 2
The answer to the problem you provided IS the remainder. You're using the modulus (or modulo) operator (%). It returns the remainder of the division. In this case it returns 2. Now, the real answer is actually -2, but I believe Python returns the positive because two positives were originally used. Check out the forums below for a complete explanation.
https://ubuntuforums.org/showthread.php?t=498178