On 15 Mar, 22:43, Guido van Brakel <[EMAIL PROTECTED]> wrote:

> > def gem(a):
> >     g = sum(a) / len(a)
> >     return g

> It now gives a int, but i would like to see floats. How can integrate
> that into the function?

You get an int because you are doing integer division. Cast one int to
float.

def gem(a):
   g = sum(a) / float(len(a))
   return g



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to