Each atom in the dictionary is given by its atomic number and mass number . You will write a function that says whether two atoms are isotopes, isobars or neither, then count each kind of pair, and find the pairs with the same number of neutrons.
The idea. Isotopes have the same and a different . Isobars have the same and a different . The neutrons are .
Your tasks.
relation, return "isotopes", "isobars" or "neither".n_isotopes and n_isobars over every pair of atoms.same_neutrons with every pair, as a tuple of two names, that has the same number of neutrons.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…