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

I know this error is something related to float, but not able to get through it. Hints would be helpful. Thanks!

```
def median(lst):
a = sorted(lst)
med = 0
if len(a)%2 == 0:
mid = len(a)/2
med = float((lst[mid-1] + lst[mid])/2)
else:
mid = (len(a)+1)/2
med = (lst[mid-1])
return med
```