You will write four functions for the lesson on addition polymers. One finds the relative formula mass of a repeat unit from the four groups on its two carbon atoms. One finds the mass of a chain. One finds the number of repeat units in a chain. One finds the percentage of a group in the polymer.
The idea. The repeat unit has two carbon atoms, with a relative mass of , and four groups. The groups are "H" (1), "CH3" (15), "F" (19) and "Cl" (35.5). PVC has the groups ["H", "H", "H", "Cl"].
Your tasks.
repeat_unit_mr(groups).chain_mr(unit_mr, n).units_in_chain(chain_mass, unit_mr), which gives a whole number.percent_of(group, groups), which gives the percentage by mass of that group in the repeat unit.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…