https://www.codecademy.com/courses/python-intermediate-en-rCQKw/2/5?curriculum_id=4f89dab3d788890003000096#

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

I don't know where my code goes wrong. Help.

```
def median(input_list):
output_list = sorted(input_list)
n = len(output_list)
x = int(n / 2)
if n % 2 == 0:
median_even = (output_list[x] + output_list[x+1]) / 2.0
return median_even
elif n == 1:
median_1 = 1
return median_1
else:
median_odd = output_list[x+1]
return median_odd
```