Hello all, here's a link to the exercise:

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

My code (figuring below) fails when attempting to find the median of this list [4,5,4,5]

I get the following error message:

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

even though my code seems okay to me: I made sure to put a (-1) when referring to the index of the first list element involved in the calculation of the median which I thought to be the main challenge of the program.

Thanks for the help!

```
def median(lst):
new_lst = sorted(lst)
if len(new_lst) % 2 == 0:
return ((new_lst[(len(lst) / 2) - 1]) + (new_lst[(len(lst) / 2)])) / 2
if len(new_lst) % 2 != 0:
return new_lst[(len(lst)) / 2]
```