Median Problem


#1




Oops, try again. median([4, 5, 5, 4]) returned 4 instead of 4.5


Replace this line with your code. 
def median(lista):
    lista = sorted(lista)
    if len(lista) % 2 == 0:
        return (lista[len(lista) / 2 ] + lista[(len(lista) / 2) - 1])/ 2
    else:
        return lista[len(lista) // 2]


#2

dividing two integers (9 / 2) will return a integer (4) if needs be the number is floored. You will need to do something with a float (decimal number)


#3

Oh my god just a .0 and it worked!! Thank you so much for your time and sorry for my poor english!


#4

yep, that would be the best and easiest fix to apply. No need to apologizes.


#5