You will write your own median, then a function that returns the five-number summary with the rule of this chapter, and a function for the IQR.
The idea. Sort the data. The median is the middle value, or the mean of the two middle values. With an odd count, leave the median out of both halves. The quartiles are the medians of the halves.
Your tasks.
median_of(values).five_numbers(data). Return a list [minimum, q1, median, q3, maximum].iqr(data).Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…