Hi, I don't understand why isn't this working. I'm not much concentrated so this may be just all wrong.Please help me, thanks

This was the error message:

Oops, try again. median([1]) resulted in an error: 'int' object has no attribute '**getitem**'

```
def median(x):
final = 0
sorted(x)
if len(x) % 2 == 0:
return final[len(x)/2]+final[len(x)/2+1] / 2
else:
return final[len(x)-1/2+1]
```