Median Score
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
1 <= len(scores) <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Multiples Up ToBeginner
- Overlap CountBeginner
- Pass or FailBeginner
- Percent of TotalBeginner
- Pick ItemsBeginner
- Price With TaxBeginner
- Range of ReadingsBeginner
- Recent AverageBeginner