A foundry mixes metals by a recipe in percent. You will make the program work out the mass of each metal for any amount of alloy, check that a recipe adds up to , and find the copper for a bronze bell.
The idea. Mass of a metal = total mass × its percentage ÷ . A recipe is only valid if its percentages add up to .
Your tasks.
masses, return a dictionary of the mass of each metal.valid, return True when the percentages add up to .copper_bell, the copper in of the bell bronze.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 5 more problems and 2 Python labs. Everything you have used here stays free, always.