Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Median by a.a.v.worker
def checkio(data):
if data:
data = sorted(data)
if len(data) == 1: return data[0]
elif len(data) % 2: return data[len(data)//2]
else: return (data[len(data)//2 - 1] + data[len(data)//2])/2
else: print("Empty list")
Aug. 5, 2015