Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Median by desecho
def checkio(data):
def find_median_values():
data.sort()
data_length = len(data)
start = data_length / 2
end = start + 1
if data_length % 2 == 0:
start -= 1
return data[start:end]
data = find_median_values()
if len(data) == 1:
return data[0]
else:
return (data[0] + data[1]) / 2.0
March 15, 2015