Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
MaxRake.com way solution in Clear category for Median by maxrake
def checkio(data):
"""compute the median of a list of numbers"""
length = len(data)
sorted_data = sorted(data)
if length % 2: # odd length
median = sorted_data[length//2]
else: # even length
median = (sorted_data[length//2] + sorted_data[length//2 - 1]) / 2
return median
July 22, 2015