Median - solution question


Question. For this exercise it does not say we cannot use statistics.median() so is my code not working because its not supported in codeacademy?

import statistics
def median(x):
    return statistics.median(x)


We should be using what we have learned up to this point. Modules do not come up until the end of the course.


Ahhh. got it. I do always appreciate the problems that require me to think like a computer acts. Seems that's the stuff that always sticks. Ill try to find another solution.

Thank you


Recall that median is captured from the middle of a sorted sample space.

Lists are zero-indexed.

Indexes must be integers.

Even length lists need to return a float.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.