Practice makes perfect - Median

Can anybody tell me what is wrong with my code?Thanks

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

```
def median(lista):
#return the median value of the list
listaOrd = sorted(lista)
middle = 0
half = len(listaOrd) / 2
half2 = half - 1
for i in listaOrd:
if len(listaOrd) == 1:
return i
elif i % 2 == 0:
middle = (half + half2) / 2.0
else:
middle = sum(i for i in listaOrd) // len(listaOrd)
return middle
```