Six friends have pocket money close together, from 21 to 26 rupees, and a seventh friend can have much more. You will write the mean and the median, then find how large the seventh amount must be before the mean is more than 10 rupees above the median.
The idea. The mean uses every value, so one large value drags it. The median is the middle of the sorted list, so it hardly moves.
Your tasks.
mean, return the total of values divided by how many there are.median, return the middle value of the sorted list. Here the list always has an odd number of values.first_big to the first amount in tries that makes mean - median more than 10.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…
With Standard, you also open 8 more problems, 3 Python labs and 1 extra course. Everything you have used here stays free, always.