input: Write a function to convert the input list of people with their ages into a Python dictionary where the names are the keys and the ages are the values.
  assert convert_to_dict("John (20), Jane (40), Alex (18), Peter (45)")=={'John': 20, 'Jane': 40, 'Alex': 18, 'Peter': 45}
  assert convert_to_dict("Sam (32)")=={'Sam': 32}
  assert convert_to_dict("")=={}
output: def convert_to_dict(s):
      if not s:
          return {}
      pairs = s.split(", ")
      result = {}
      for pair in pairs:
          name, age = pair.split(" (")
          age = int(age.rstrip(")"))
          result[name] = age
      return result