Dividing integers...Convert to float first?

Grant Edwards grante at visi.com
Fri Jan 5 18:41:55 CET 2007


On 2007-01-05, Jonathan Smith <smithj at rpath.com> wrote:

> >>> from __future__ import division
> >>> 1/2
> 0.5

   $ python
   Python 2.4.3 (#1, Dec 10 2006, 22:09:09) 
   [GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2
   Type "help", "copyright", "credits" or "license" for more
   information.
   >>> from __future__ import LotteryNumbers
     File "<stdin>", line 1
   SyntaxError: future feature LotteryNumbers is not defined
   >>> 

Damn.  

I guess it's back to work then.

-- 
Grant Edwards                   grante             Yow!  It's a lot of fun
                                  at               being alive... I wonder if
                               visi.com            my bed is made?!?



More information about the Python-list mailing list