FunctionRacerProblemsRace

Median Score

BeginnerNumPyPython

Return the median of scores: the middle value once they are sorted, or the average of the two middle values when there is an even number of scores. Return a float. Hint: np.median.

Example 1

scores [9,1,5]
returns 5.0

Sorted: 1, 5, 9. The middle is 5.

Example 2

scores [4,1,3,2]
returns 2.5

Sorted: 1, 2, 3, 4. The middle two are 2 and 3, so 2.5.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems