Put the lesson Tuples into practice by writing a program yourself.
Each element in a compound can be stored as a tuple of (symbol, atomic mass, count). Alumina (Al₂O₃), a common ceramic, is two aluminium atoms and three oxygen atoms.
Unpack both tuples into variables, print each element, then calculate the molar mass.
Al: 2 × 26.982.Molar mass of Al2O3: 101.961 g/mol (3 decimal places).Al: 2 × 26.982 O: 3 × 15.999 Molar mass of Al2O3: 101.961 g/mol
Write your program below and press Run. Each run is checked against the expected output.
Press Run to see what your program prints.
One possible solution. Other programs that print the same output are correct too.
aluminium = ("Al", 26.982, 2)oxygen = ("O", 15.999, 3)symbol_al, mass_al, count_al = aluminiumsymbol_o, mass_o, count_o = oxygenprint(f"{symbol_al}: {count_al} × {mass_al}")print(f"{symbol_o}: {count_o} × {mass_o}")molar_mass = mass_al * count_al + mass_o * count_oprint(f"Molar mass of Al2O3: {molar_mass:.3f} g/mol")