Error: Oops, try again. median() resulted in an error: list indices must be integers, not float.
Can anybody explain me pls, what I ve done wrong? Cause I dont have a clue.
def median(numbers): numbers = sorted(numbers) median = 0 if len(numbers) % 2 == 0: median = (numbers[len(numbers) / 2] + numbers[len(numbers) / 2 - 1]) / 2 else: median = numbers[round(len(numbers) / 2)] return median