[Tutor] modulo

Esteban Izaguirre estebaniza at gmail.com
Mon Oct 8 00:49:58 CEST 2012


Hi, I'm following coursera's learn to program: the fundamentals, which
teaches programming basics in python. Our first assignement involves the
modulo operator with a negative divident, and while I've managed to get to
understand it enough for the purposes of the assignement with help from
othe rstudents, I still don't know how the hell it works, I wouldn't know
how to use modulo in another situation if it ever arised. So, i undertand
how modulo works when only positive numbers are used, but how does modulo
determine, that, say -15 % 14 is equal to 13? Or -20 % 100 is 20? I just
don't get how modulo works, all explanations I've found online only seem to
be in relation of how this applies to perl or something, can someone
explain it to me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121008/141f61e9/attachment.html>


More information about the Tutor mailing list