median([4, 5, 5, 4]) returned 5 instead of 4.5 , I think I am misusing the sorted function.

```
def median(numbers):
sort=sorted(numbers)
a= int((len(sort)/2)+.5) #for a list with an odd number of elements a= the middle element.
if len(sort)%2!=0: # if the list is odd
return sort[a] #return middle value
else: #if list is even
x=len(sort)/2 # x is the lower of the two middle terms
answer=(sort[x]+sort[x+1])/2 #average the two middle terms
return answer
```