[Tutor] Simple variable type question

Luke Paireepinart rabidpoobear at gmail.com
Fri Feb 5 20:25:47 CET 2010


On Fri, Feb 5, 2010 at 12:45 PM, Alan Gauld <alan.gauld at btinternet.com>wrote:

>
> "Antonio de la Fuente" <toni at muybien.org> wrote
>
>> the doctest for the slope function failed, because is expecting a
>>
>> floating point value and not an integer:
>>
>
> So convert it to a float.
>
> Or just
>     return float(y2-y1/x2-x1)
>
> Alan why are you suggesting this, surely this will cause the decimal values
to be truncated?  Or does this somehow work differently in Python 3?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100205/70e29c15/attachment.htm>


More information about the Tutor mailing list