So i feel like the code is correct, but apparently the list index is out of range.

```
def median(x):
l = sorted(x)
n = len(l)
answer = 0
if n % 2 != 1:
answer = ((l[(n/2)]) + (l[(n+2)/2])) / 2
return answer
else:
answer = l[(n+1)/2]
return answer
```