You will write a program that reads the groups on the phosphorus atoms of an acid and works out its oxidation state, its basicity and the base it needs.
The idea. Each acid is described by five numbers: P-H bonds, P-OH groups, P=O bonds, bridging oxygen atoms and phosphorus atoms. The oxidation state of phosphorus comes from the hydrogen and oxygen counts. The basicity is the number of P-OH groups.
Your tasks.
oxidation_state(name). Count the oxygen atoms (P-OH, P=O and bridging) and the hydrogen atoms (P-H and P-OH). Use .basicity(name) so that it returns the number of P-OH groups.naoh_needed(name, mmol) so that it returns the mmol of sodium hydroxide that neutralise that amount of the acid.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.