Ensure a variable is divisible by 4
Jonathan Smith
smithj at rpath.com
Tue Dec 5 23:55:17 EST 2006
More information about the Python-list mailing list
Tue Dec 5 23:55:17 EST 2006
- Previous message (by thread): Ensure a variable is divisible by 4
- Next message (by thread): newb: Join two string variables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
MRAB wrote: >> if ( x % 4 ) == 0: >> whatever # x is divisible by 4 >> >> modulus is your friend :) >> >> -smithj > > <pendantic> > It's "modulo"; "modulus" is a different operation. > </pedantic> > Wikipedia says "modulus may refer to... %, the modulo operator of various programming languages" http://en.wikipedia.org/wiki/Modulus That being said, you may be right and it may just be a common mistake. -smithj
- Previous message (by thread): Ensure a variable is divisible by 4
- Next message (by thread): newb: Join two string variables
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list