"Robert Brewer" <[EMAIL PROTECTED]> wrote: > > Josiah Carlson wrote: > > [EMAIL PROTECTED] (Sean McIlroy) wrote: > > > > > > >>> median = lambda x: (max(x)-min(x))/2 > > > > That is /not/ the median in the general case. > > > > 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. If you're really good, you can do crazy stuff with list comprehensions. I'll leave that exercise up to the reader, as many of my examples are in for-pay code. - Josiah -- http://mail.python.org/mailman/listinfo/python-list