This is my code -

```
def median(intlist):
if len(intlist) == 1:
return intlist[0]
elif len(intlist) % 2 == 0:
intlist = intlist.sort()
a = intlist[(len(intlist) / 2) - 1]
b = intlist[a + 1]
return (a + b) / 2
else:
intlist = intlist.sort()
return intlist[((len(intlist) + 1) / 2) - 1]
```

The error is -

Oops, try again. median([4, 5, 5, 4]) resulted in an error: object of type 'NoneType' has no len()

I cannot see what is wrong