[Tutor] correcting an Active State Recipe for conversion to ordinal

Serdar Tumgoren zstumgoren at gmail.com
Thu Feb 4 20:28:50 CET 2010


> It now works ok but..
>
> You should not use ord as variable as ord() is used by python already.
>
> Also this will fail in python 3 and 2 with import from future, it does
> division differently.
>>>> from __future__ import division
>>>> 11 % 100 / 10
> 1.1000000000000001
>
> So "if value % 100/10 <> 1:" should be "if value < 10 or value > 13:".
>

I see. I'll update it accordingly. Many thanks!


More information about the Tutor mailing list