Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Median by PawelBubak
def checkio(data):
list = []
for i in data:
list[len(list):] = [i]
x = len(list)
list.sort()
if x%2 == 0:
x = int(x/2 - 1)
y = int(x + 1)
wynik = (list[x]+list[y])/2
return wynik
elif x%2 == 1:
x = int((x-1)/2)
return list[x]
Oct. 30, 2016