def median ( ls ) : ls = sorted ( ls ) return ls [ int ( floor ( len ( ls ) / 2.0 ) ) ]
python formula for median of even numbered list
Takes a list and returns the median .
def median(ls):
    """
    Takes a list and returns the median.
    """
    ls = sorted(ls)
    return ls[int(floor(len(ls)/2.0))]