Median - solution question


#1



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


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)


#2

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


#3

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


#4

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.


#5

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