You will write three functions that decide whether an acid reacts with a base, from the pKa values.
The idea. For an acid HA and a base B, the equilibrium constant is . A very large K means the reaction goes to completion. A very small K means almost nothing happens. The share of an acid present as its anion at a given pH is percent.
Your tasks.
percent_anion(pka, ph) so that it returns the share of the acid present as its anion, in percent.equilibrium_constant(pka_acid, pka_conjugate) so that it returns K for the acid with a base whose conjugate acid has the second pKa.verdict(k) so that it returns "goes" when K is above 1000, "no reaction" when K is below 0.001, and "partly" otherwise.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…