[N00B] What's %?

Peter Hansen peter at engcorp.com
Thu Feb 10 14:41:36 EST 2005


Grant Edwards wrote:
> It's the modulus operator.  It returns the remainder of integer
> division.  As we used to say in second grade:
> 
>  4 goes into 107 26 times with 3 left over.
> 
>  3 goes into 4 2 times with 1 left over. 

How long were you stuck in second grade, Grant?  <grin>

-Peter

P.S.  You're correct, for large values of four.... ;-)



More information about the Python-list mailing list