Stuck on the median problem. My code works fine in my IDE which is Python 3.5.2 but I believe these lessons are in Python 2.x

It was stuck on `median([4, 5, 5, 4]) returned 4 instead of 4.5`

for a while until I changed from integer to float division and now it gives me the error message `median([6, 8, 12, 2, 23]) returned 6 instead of 8`

Here is what my code looks like:

```
def median(sequence):
sequence = sorted(sequence)
if (((len(sequence)) % 2) > 0):
return sequence[int((((len(sequence)) / 2) - .5))]
else:
return (((sequence[int(len(sequence)/2-1)])+(sequence[int(len(sequence)/2)]))/2.0)
```