Larry Bates <[EMAIL PROTECTED]> writes:

> And why is that superior to this:
> 
> def avg(l):
>     return float(sum(l))/len(l)
> 
> >>>avg([1,2,3,4])
> 2.5

Apart from being less to type and it is superior in that it's generalizes much
better, e.g:

avg&.^.   NB. geomtric mean
avg&.%    NB. harmonic mean
avg M     NB. column mean of matrix M
avg"1 M   NB. row mean of matrix M

'as

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

Reply via email to