python only prints integers
kost-bebix at yandex.ua
Fri Jan 7 00:09:22 CET 2011
Well, that's because 20 is integer. To get float you can write 20.0 (or 20.).
20.0/8.0 = 2.5
8.0/3.0 = 2.6666666666666665
07.01.2011, 00:49, "francesco" <cerutti.francesco.to at gmail.com>:
> I'm pretty new in Python language. I have a problem with numbers: it
> seems python doesn't know any more how to count!
> I get only the down rounded integer
> 20/8 = 2
> I probably changed some option to round the numbers, but I don't
> remember how.
> Is there a way to reset the number of digits to default?
> Thanks in advance
jabber: kost-bebix at ya.ru
More information about the Python-list