median() returned  instead of 1
So my code seems to be working, at least for the first list, but when I run it, it throws me the error. median() returned  instead of 1
I think somewhere along the way this sort of thing was covered. But i forget where at.
My question, pretty much, is how to remove the brackets from what the function returns.
def median(x): final = sorted(x) if len(final) % 2 == 0: while len(final) > 2: final.remove final.remove[len(final)] else: while len(final) != 1: final.remove final.remove[len(final)] if len(final) == 2: avg = final + final avg = avg/2 final = avg return final