python only prints integers

kost BebiX kost-bebix at yandex.ua
Thu Jan 6 18:09:22 EST 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
> 8/3=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
>
> --
> http://mail.python.org/mailman/listinfo/python-list

-- 
jabber: kost-bebix at ya.ru



More information about the Python-list mailing list