Error: "Oops, try again. median([1]) returned [1] instead of 1"

```
def median(n):
ready = []
ready.append(sorted(n))
length = len(ready)
if length % 2 == 0:
mid_1 = length / 2
middle_1 = ready[mid_1]
mid_2 = mid_1 + 1
middle_2 = ready[mid_2]
median = (middle_1 + middle_2) / 2.0
return median
else:
mid = length / 2
median = ready[mid]
return median
```