I have this error message
Oops, try again. median() resulted in an error: list index out of range
I think my code is must work correctly. Where is the problem?
Replace this line with your code. def median(n): n=sorted(n) total = len(n) if total % 2 != 0: mid = (total+1)/2 med = n[mid] else: mid_1=(total+2)/2 mid_2=total/2 med=(mid_1+mid_2)/2 return med