15/15 Median Help



The code below for 15/15 (calculating medians) is throwing up the following error:

File "python", line 7
SyntaxError: invalid syntax

I am unable to figure out what is causing this and help would be appreciated
(by the way, I know it's counter-intuitive that I'm using array for length measurements but i doubt that would make a difference)

def median(array):
    ordered_list = sorted(array)
    if len(array) % 2 == 0:
        return (ordered_list[len(array) / 2] + (ordered_list[(len(array) / 2)-1]) / 2
        return ordered_list[(len(array)/2)-0.5]


Just looking at the error you receiving, the problem is the line above:

return (ordered_list[len(array) / 2] + (ordered_list[(len(array) / 2)-1]) / 2

take a good look at all brackets, the ( bracket after return doesn't have a matching closing bracket

Now, this is just a step in the right direction, please take a moment to check your own code before posting again. Good luck!