Code not working properly


why does this code doesn't work?

def median(listx):
    listk = sorted(listx)
    if count%2 == 0:
        m1= listk[((count-1)-1)/2]
        m2 = listk[((count-1)+1)/2]
        mediane= (m1+m2)/2
        mediane = m3
    return mediane
print median(listy)


the problem is here:

mediane= (m1+m2)/2

because the division only involves integers, the result will be an integer as well (if needs be, python will floor/round down to the nearest integer)

Pretty big hint, see if you can figure it out. Otherwise there is another hint here:

the division should involve a float to prevent the number from getting rounded down


thanks mate! :smiley: