code: def chemical_formula(self):
          
          counts = {}
          for number in self.numbers:
              counts[number] = counts.get(number, 0)+1
          items = []
          for number, count in sorted(counts.items(), reverse=True):
              if count == 1:
                  items.append(periodic[number].symbol)
              else:
                  items.append("%s%i" % (periodic[number].symbol, count))
          return "".join(items)
docs: the chemical formula of the molecule