Hi all,

Wondering why this code isn’t working. It’s probably a really silly and obvious mistake, so please be gentle with me:

```
import math
def median(mylst):
l = sorted(mylst)
# if the list has an even number of elements
if len(l) % 2 == 0:
first_mid = l[int(math.floor(len(l)/2))]
last_mid = l[int(math.ceil(len(l)/2))]
mid_avg = (first_mid + last_mid) / 2.0
return mid_avg
# if the list has odd num elements
else:
return l[int(math.ceil(len(l)/2))]
```

I get the error: median([4, 5, 5, 4]) returned 5.0 instead of 4.5