input: Write a function to create a dictionary from a list of names and their corresponding ages, with the names as keys and the ages as values.
  assert create_age_dict("John (20), Jane (40), Alex (18), Peter (45)") == {'John': 20, 'Jane': 40, 'Alex': 18, 'Peter': 45}
  assert create_age_dict("Alex (18), Peter (45)") == {'Alex': 18, 'Peter': 45}
  assert create_age_dict("") == {}
  assert create_age_dict("John (20), Jane (40), Alex (18)") == {'John': 20, 'Jane': 40, 'Alex': 18}
  assert create_age_dict("Peter (45)") == {'Peter': 45}
output: def create_age_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