Hi, Guys. Can't figure out whats wrong. Check working codes in other threads and seems that is no difference but my code does not work. Give an error:

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

```
def median(x):
med = 0
x = sorted(x)
index1 = len(x) / 2
index2 = len(x) / 2 - 1
if index1 % 2 == 0:
med = index1 + index2 / 2
else:
med = len(x) / 2
return med
```

Thanks