On Wed, Aug 31, 2011 at 9:35 PM, Lisi <[email protected]> wrote: > ?? If either n or x or both were 0, and % were the same thing as *, the > statement would be true, but from the context I don't think that % does mean > the same as *, because * appears very soon after in the same fragment of > code. > > Lisi > > I'm sorry I am making such heavy weather of all this. Blame 2 things: anno > domini and an exaggerated (obsessive) need to understand language.
% is the remainder operator: http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex it is how much remains after you perform an integer division, e.g. 23 % 5 == 3, since 20 / 5 == 4 and then you are left with 3. n % y == 0 if n is divisible by y. This is useful in factoring prime numbers, and in the case of y == 2, for checking if the number n is even. Hugo _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
