In <[EMAIL PROTECTED]>, Frank Millman
wrote:

> Why not think to the future, and do it like this. Instruct the reader
> to enter 'from __future__ import division'. You do not have to explain
> the details, just say that this is the way division will work in the
> future, and this statement will eventually not be required.
> 
> Then your example will show that 3/2 = 1.5, which is what they would
> expect.
> 
> Then you can mention that, if they just want the integer portion, they
> can use int(3/2). I think that most people with the slightest
> understanding of basic arithmetic will relate to this without a
> problem.

Or instead of converting the `float` back to an `int`, they can use
integer division:  ``3 // 2``

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to