You will write functions that sort polymers into their classes from a small table. Each polymer has three labels: its class by forces, its structure and how it forms.
The idea. A table holds what we know. A function reads one column and gathers the polymers that match.
Your tasks.
members(column, value). It returns a sorted list of the polymers whose label in that column (0, 1 or 2) equals value.is_copolymer(name). It returns True when the polymer's monomer list in MONOMERS has more than one monomer.counts(column). It returns a dictionary from each label in that column to the number of polymers with it.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…