You will write the functions that decide how to split a solvent between extractions.
The idea. After one shake of a volume v of solvent with a volume V of water, the fraction of solute left in the water is . After n equal shakes it is that fraction to the power n.
Your tasks.
fraction_left(K, V, v, n).extracted_percent(K, V, total, n). It splits total into n equal portions and returns the percentage taken out.portions_needed(K, V, total, target). It returns the smallest number of equal portions, from 1 to 20, that takes out at least target percent, or 0 if none does.Run your code once to unlock the worked solution.
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…