I keeps giving me error. cant I use enumerate function?

the error:

Oops, try again. median([1]) returned -0.5 instead of 1

```
def median(x):
for index, item in enumerate(x):
index1=len(x) / 2
index2=len(x)/2 - 1
if len(x) % 2 == 0:
return (index1 + index2) / 2
elif len(x) % 2 ==1:
return (index1 + index2)/2.0
```