Help interpreter revolting refuses to return float numbers


#1

Quite frankly, nothing's wrong with my code rather i believe there may be something wrong with the interpreter. Just in case, here is my code

def median(l):
l = sorted(l)
med = 0

if len(l)%2 == 0:
    b = len(l) - 1

    med = (l[int(b/2)] + l[int(b/2) + 1])/2

else:
    med = l[int((len(l))/2)]

return med

#2

In order to return floats you should use float operation. Example:

5.0 / 2.0

Make your integers floats.