On Mar 15, 4:43 pm, Guido van Brakel <[EMAIL PROTECTED]> wrote: > Hello > > I have this now: > > > def gem(a): > > g = sum(a) / len(a) > > return g > > > print gem([1,2,3,4]) > > print gem([1,10,100,1000]) > > print gem([1,-2,3,-4,5]) > > It now gives a int, but i would like to see floats. How can integrate > that into the function?
If you add "from __future__ import division" at the top of the file, division will work properly. -- http://mail.python.org/mailman/listinfo/python-list