I just got started with Python PCEP course material on netacad.com.
I've come across the following exercises:
2 % -4 = -2
2 % 4 = 2
As I understand it, the modulo operator returns the remainder of a division. So 2 divided by (-4) gives (-0.5). How does Python3 calculate the remainder of that as 2?
I know it's stupid but what's the reasoning behind that result?