Fractions as result from divisions (was: Re: tough-to-explain Python)

kj no.email at please.post
Wed Jul 8 07:59:19 EDT 2009


In <c75ei6-e0i.ln1 at satorlaser.homedns.org> Ulrich Eckhardt <eckhardt at satorlaser.com> writes:

>Bearophile wrote:
>> For example a novice wants to see 124 / 38 to return the 62/19
>> fraction and not 3 or 3.263157894736842 :-)

>Python has adopted the latter of the three for operator / and the the second
>one for operator //. I wonder if it was considered to just return a
>fraction from that operation.

http://www.python.org/dev/peps/pep-0239/

kj




More information about the Python-list mailing list