You will write three functions that do the counting behind a Lewis structure.
The idea. The total adds the valence electrons of all atoms and corrects for the charge. A central atom joined to halogens by single bonds keeps its unused electrons as lone pairs. The electrons around it are two per bond plus two per lone pair.
Your tasks.
total_valence, return the number of valence electrons.central_lone_pairs, return the lone pairs on the central atom.octet_status, return "incomplete", "octet" or "expanded".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…