You will write three small functions for the reaction of nitrogen with hydrogen. The first finds the limiting reagent, the second the moles of ammonia, and the third the percent yield.
The idea. The equation needs 3 mol of hydrogen for each mole of nitrogen. The reagent that runs out first sets the amount of ammonia.
Your tasks.
limiting(n_n2, n_h2) so that it returns the text "N2" or "H2".ammonia_moles(n_n2, n_h2) so that it returns the moles of ammonia at completion.percent_yield(actual, n_n2, n_h2) so that it returns the percent yield.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 12 more problems, 2 Python labs and 1 extra course. Everything you have used here stays free, always.