Please tell me where i have gone wrong.

ERROR:median([4, 5, 5, 4]) returned 5.0 instead of 4.5

https://www.codecademy.com/courses/learn-python/lessons/practice-makes-perfect/exercises/median

```
def median(x):
y=sorted(x)
if len(y)%2==0:
sum= float((y[len(y)/2]+y[(len(y)/2)+1])/2)
return sum
else:
return y[len(y)/2]
print median([4,5,5,4])
```