This code works fine for a list whose total count is odd but for a list with even number of values , the answer is one unit less. For instance, i this example it gives me 4.5 instead of 5.5. Thank you for your patience

```
def median(inputlist):
sorted_i =sorted(inputlist)
if len(sorted_i)%2==0:# testing if number of values is even
median = float(sorted_i[(len(sorted_i)/2)-1+(len(sorted_i)/2)])/2
else:
median = sorted_i[(len(sorted_i)/2)] # number of values is odd
return median
a = (2,0,6,9,5,7,8,2,1, 6)
print median(a)
print sorted(a)
print len(a)
```

Oops, try again. median([4, 5, 5, 4]) returned 2.5 instead of 4.5

4.5

[0, 1, 2, 2, 5, 6, 6, 7, 8, 9]

10

None