[Tutor] Floating point exercise 3 from Learn python the hard way

amt 0101amt at gmail.com
Tue Jun 14 15:20:43 CEST 2011


On Tue, Jun 14, 2011 at 12:27 AM, Alan Gauld <alan.gauld at btinternet.com>wrote:

>
> I can understand why at line 5 I use floating point. 6,75 is more
>> precise than saying 7.
>>
>
> Exactly, no problem with line 5 (except the odd comment about 6.83)


The comment on line 5 was a mistake.


>
>  But I can't understand at line 2 and 3. I mean it makes no difference
>> for me. Saying 30 or 30.0 is the same thing.
>> As well as saying 97 or 97.0.
>>
>
> Precisely, thats why I asked the question.
>
>

As a beginner at line 2 and 3 I see no point of using floating numbers
except the fact to serve as an example  that if I have a floating point
number it affects the rest of the expression evaluation.

So, should I keep them or not?It's unclear to me and sadly the author of the
book doesn't provide the solutions to the exercises. The only way I can
verify myself is using this list.



Regards,
amt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110614/68e6139c/attachment.html>


More information about the Tutor mailing list