My code returns:

Oops, try again. median([4, 5, 5, 4]) returned 5.0 instead of 4.5

```
Replace this line with your code.
def median(numbers):
n = sorted(numbers)
x = 0
y = 0
z = len(n)
if z == 1:
return z
elif z == 0:
return 0
elif z%2 == 1:
return n[(z+1)/2]
elif z%2 == 0:
x = n[z/2]
y = n[(z +2)/2]
return ((x+y)/2.0)
Please help - thank you!
```