input: Write a function to create a Python dictionary with names as keys and ages as values from a given list of people. The function should return the dictionary.
  assert create_people_dict("John (20), Jane (40), Alex (18), Peter (45)") == {'John': 20, 'Jane': 40, 'Alex': 18, 'Peter': 45}
  assert create_people_dict("Alice (25), Bob (30)") == {'Alice': 25, 'Bob': 30}
  assert create_people_dict("") == {}
  assert create_people_dict("Sam (50)") == {'Sam': 50}
output: def create_people_dict(people_str):
      if not people_str:
          return {}
      people_dict = {}
      for person in people_str.split(", "):
          name, age = person.split(" (")
          age = int(age.rstrip(")"))
          people_dict[name] = age
      return people_dict