You will finish a program that names a complex from its metal, its ligands and its charge. Three small parts are missing: the prefix for the number of ligands, the name of the metal, and the alphabetical order of the ligands.
The idea. The name has the ligands in alphabetical order, each with its prefix, then the metal, then the oxidation state in Roman numerals. An anionic complex gets the -ate name of the metal.
Your tasks.
prefix(n) so that it returns the prefix for n identical ligands.metal_word(metal, charge) so that it returns the name of the metal, with the -ate name when the charge is negative.name_of, put the ligands in alphabetical order of their names.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…