Synoptic exercises

Now that you can use data structures, attempt the following exercises.

1. You have been provided with the following electronegativity data for selected groups of the periodic table.

electronegativities = {
    'group 1': (0.98, 0.93, 0.82, 0.82, 0.79, 0.79),
    'group 2': (1.57, 1.31, 1.00, 0.95, 0.89, 0.90),
    'group 13': (2.04, 1.61, 1.81, 1.78, 1.62),
    'group 14': (2.55, 1.90, 2.01, 1.96, 1.87),
    'group 15': (3.04, 2.19, 2.18, 2.05, 2.02),
    'group 16': (3.44, 2.58, 2.55, 2.10, 2.00)
}

Write code (including comments) to carry out the following steps

  1. Add the electronegativities of the group 17 elements to the dictionary as a tuple under the key 'group 17'.

  2. Calculate the difference between the mean electronegativities of the group \(1\) and group \(2\) elements.

Tip

You can call the sum function on a list or tuple to give the sum of its elements, and the len function to find the length of a list or tuple.

2. Consider the following blocks of code. Each one of them will cause an error when run. Taking each block one-by-one:

Block 1


functional_groups = ('Aldehyde', 'Ketone', 'Ester', 'Ether')

functional_groups.append('Amine')

print(f'Here is a selection of functional groups: {functional_groups}')

Block 2


The Kapustinskii equation can be used to calculate the lattice energy of an ionic crystal

\[U_{L} = \frac{kvz_{+}z_{-}}{r_{+} + r_{-}},\]

where \(k\) is a constant, \(v\) is the number of ions in the formula unit, \(z_{+}\) and \(z_{-}\) are the charges of the cation and anion, respectively, and \(r_{+}\) and \(r_{-}\) are the ionic radii of the cation and anion, respectively.

Note

This block also contains a problem which, whilst it will not cause an error, will lead to the wrong result being calculated. See if you can spot and fix this problem in addition to removing the error.

# Kapustinskii equation constant in kJ pm mol-1
k = 107900

# Lithium, Sodium, Potassium, Rubidium radii in pm
group_1_radii = ('90', '116', '152', '166')
# Fluorine, Chlorine, Bromine, Iodine radii in pm
group_7_radii = ('119', '167', '182', '206')

v = 2
z_plus = 1
z_minus = 1

radius_Na = group_1_radii[2]
radius_Cl = group_7_radii[2]

lattice_energy = (k * v * z_plus * z_minus) / (radius_Na + radius_Cl)

print(f'The lattice energy of NaCl is: {lattice_energy:.2f} kJ mol-1')