Paul Rudin wrote: > Max M <[EMAIL PROTECTED]> writes: > > > [EMAIL PROTECTED] skrev: > >> Nick Craig-Wood wrote: > >>> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>>> I am sure this is a basic math issue, but is there a better way to > >>>> ensure an int variable is divisible by 4 than by doing the following; > >>>> > >>>> x = 111 > >>>> x = (x /4) * 4 > > > > X *= 4 > > > > ;-) > > > > > x=4 > > :)
Ensure x is divisible by *any* non-zero integer: x = 0 :-O -- http://mail.python.org/mailman/listinfo/python-list