It gives the following message :Oops, try again. Your code did not run to end. Check the console window for errors!
I have to find the median. What should I do to make it correct, please help.
def median(numbers): new_list = sorted(numbers ) for number in new_list: if len(new_list) % 2 != 0: position = (len(new_list) + 1) / 2 medn = new_list[position] else: position1 = (len(new_list)/2) position2 = (len(new_list) + 2)/2 medn = (new_list[position1] + new_list[position2])/2 return medn