Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Median by jani
def checkio(data):
sorted_data = sorted(data)
length = len(data)
if (length % 2) == 1:
return sorted_data[length//2]
return (sorted_data[length//2 - 1] + sorted_data[length//2]) / 2
June 30, 2015
Comments: