Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
median solution in Creative category for Median by sandarovich
def checkio(data):
data = sorted(data)
middle = int(len(data)/2)
if len(data) % 2 != 0:
return data[middle]
else:
return (data[middle-1] + data[middle]) / float(2)
#replace this for solution
#These "asserts" using only for self-checking and not necessary for auto-testing
May 13, 2014