```
python
Replace this line with your code.
```

def median(N):

m = 0

N = sorted(N)

l = len(N)

if l > 1:

if l % 2 != 0:

m += N[(l-1) / 2 ]

elif l % 2 == 0:

m += int((N[l/2-1] + N[l/2]) / 2)

elif l == 1:

m += N[0]

return m

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