It says : **"median([4, 5, 5, 4]) returned 4 instead of 4.5 "**. Nevertheless, I tried to test the code in Python shell and it returns 4.5. What am I doing wrong?

```
def median(x):
z = sorted(x)
if len(x) % 2 == 0:
mid = int((len(x) / 2))
y = (z[mid] + z[mid - 1]) / 2
return y
else:
y = z[int(len(x) / 2 - 0.5)]
return y
```