Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Median by radekj
def checkio(data):
data.sort()
half_length = len(data) // 2
if len(data) % 2:
return data[half_length]
return (data[half_length] + data[half_length - 1]) / 2.0
#These "asserts" using only for self-checking and not necessary for auto-testing
May 24, 2014
Comments: