You will write a formal charge function, add up the sizes of the charges, and use them to choose the best Lewis structure of the phosphate ion.
The idea. Formal charge . The best structure has the smallest sum of the sizes of its formal charges.
Your tasks.
formal_charge(valence, lone_electrons, bonds).size_sum(charges), the sum of the sizes of a list of charges.best_k to the number of double bonds with the smallest sum.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…