Easy function, please help.
RJB
rbotting at csusb.edu
Wed Feb 9 09:27:40 EST 2011
On Feb 8, 11:08 pm, Paul Rudin <paul.nos... at rudin.co.uk> wrote:
> It works because 0 tests false and because integer division yields
> integers... eventually you'll get something like 1/10 giving 0.
>
> It's not necessarily a good thing to rely on. For example if you try it
> after "from __future__ import division" - or in python 3 - you'll get a
> float as the result of the division and it won't test False.
What operator should I use if I want integer division?
Ada and Pascal used "div" if I recall rightly.
More information about the Python-list
mailing list