On 6 Gen, 23:59, Ian <ian.g.ke...@gmail.com> wrote: > On Jan 6, 3: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? > > In Python 2, the '/' operator performs integer division by default > when both its operands are integers. To change this, either place > this at the top of the file: > > from __future__ import division > > or convert your numbers to floats: > > >>> 20.0 / 8.0 > 2.5 > >>> float(20) / float(8) > > 2.5 > > In Python 3, the '/' operator always performs true division.
Thanks to all! Very quick answer! I fixed the problem by using floats. Thanks again -- http://mail.python.org/mailman/listinfo/python-list