You will write a function for the mean of a table with one unknown frequency. Then you will search for the value that gives a target mean, and check whether an answer exists.
The idea. The mean is with both parts in terms of the unknown frequency. A frequency is a whole number that is not negative.
Your tasks.
mean_with, return the mean of the table when the missing frequency is x. The class marks and the known frequencies are given, and the missing one is the last frequency.find_x, return the whole number x from to that gives the target mean, or None if there is none.possible to True if a whole number gives a mean of for the table below, and False if not.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…