Oops, try again. median([1]) resulted in an error: list index out of range

```
def median(numbers):
numbers.sort()
if len(numbers)%2!=0:
middle=numbers[len(numbers)/2]
elif len(numbers)%2==0:
middle=(numbers[len(numbers)/2]+(numbers[len(numbers)/2]-1))/2.0
return middle
```