On Thu, Jan 6, 2011 at 10:49 PM, francesco
<cerutti.francesco...@gmail.com>wrote:

> 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
>

Hi, the problem is that you've used two integers, which in turn return an
integer. In order to get around your problem, try 20.0/8 - the 20.0 is a
float, which will return a float. Have a read here -
http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex

Might I also suggest that you use the tu...@python.org mailing list for
beginner questions - you'll get more help there. :)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to