[Tutor] floats acting like integers???
kyeser at earthlink.net
Tue Jul 27 01:51:25 CEST 2004
Hi. To get floats for divisions, either the number you are dividing or
being divided should be a floating point.
>>> a = 1.0 / 7 # or a = 1 / 7.0
>>> print a
On Jul 26, 2004, at 7:45 PM, Jeff Peery wrote:
> hello, I have a problem with my IDLE or script. I put in something
> like a=1/7 and I print a and get zero? but this is only for division,
> numbers go to integers? anyone have an idea of why this is happening?
> Tutor maillist - Tutor at python.org
More information about the Tutor