input: Write a function to convert a list of names with their respective ages into a Python dictionary where the names are keys and the ages are values.
  
  def convert_to_dict(people_list):
      people_dict = {}
      for person in people_list:
          name, age = person.split(' ')[0], int(person.split(' ')[1].strip('()'))
          people_dict[name] = age
      return people_dict
  
  assert convert_to_dict(['John (20)', 'Jane (40)', 'Alex (18)', 'Peter (45)'])=={'John': 20, 'Jane': 40, 'Alex': 18, 'Peter': 45}
output: def convert_to_dict(people_list):
      people_dict = {}
      for person in people_list:
          name, age = person.split(' ')[0], int(person.split(' ')[1].strip('()'))
          people_dict[name] = age
      return people_dict