Mean, median, and mode

Paul Rubin http
Mon Dec 6 16:43:27 EST 2004


Josiah Carlson <jcarlson at uci.edu> writes:
> > > median = lambda x: x.sort() or x[len(x)//2]
> > 
> > That...is a really sneaky use of null return values. I like. :)
> 
> Thank you, I'm just using a paradigm (exploiting lambdas) that I picked
> up while going through various functional programming modules.

Yucch!!

median = x.sorted()[len(x)//2]



More information about the Python-list mailing list