input: Write a function to create a Python dictionary with names as keys and ages as values from a given input list of people. The input list is in the format of "name (age)" and includes multiple people. If the input list is empty, the function should return an empty dictionary.
  assert convert_to_dict("John (20), Jane (40), Alex (18), Peter (45)")=={'John': 20, 'Jane': 40, 'Alex': 18, 'Peter': 45}
  assert convert_to_dict("")=={}
output: def convert_to_dict(input_list):
      if not input_list:
          return {}
      result = {}
      for person in input_list.split(", "):
          name, age = person.split(" (")
          age = int(age.rstrip(")"))
          result[name] = age
      return result