[Tutor] Evaluate my script?
Luke Paireepinart
rabidpoobear at gmail.com
Tue Oct 24 17:35:35 CEST 2006
Kent Johnson wrote:
> Luke Paireepinart wrote:
>
>> so in Python 3000 there's no more integer division?
>> I hope this is not the case.
>> Sometimes it's the desired action, like when you repeatedly divide/mod a
>> variable.
>>
>
> Integer division is still available using the // operator:
>
> In [1]: from __future__ import division
>
> In [2]: 3/2
> Out[2]: 1.5
>
> In [3]: 3//2
> Out[3]: 1
>
Ah, that's good news.
It also makes it more clear what you expect the result to be.
Thanks for the info.
More information about the Tutor
mailing list