You will write functions for the analysis of an organic compound: the per cent of carbon and hydrogen from the masses of carbon dioxide and water, the per cent of nitrogen by the Kjeldahl method, and the empirical formula from the percentages.
The idea. g of carbon in every g of carbon dioxide, and g of hydrogen in every g of water. For nitrogen, . For the formula, divide each per cent by the atomic mass, and then by the smallest answer.
Your tasks.
percent_carbon(sample, co2) and percent_hydrogen(sample, water).kjeldahl(sample, molarity, volume, basicity).empirical(percents): return a dictionary with the whole number ratio of the atoms, from masses.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…