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