input: Write a function that takes a list of names and ages in the format "Name (age)" and returns a dictionary where the names are keys and the ages are values. If the input is empty, return an empty dictionary.
  
  assert create_dict(["John (20)", "Jane (40)", "Alex (18)", "Peter (45)"]) == {'John': 20, 'Jane': 40, 'Alex': 18, 'Peter': 45}
  assert create_dict([]) == {}
output: def create_dict(names_ages):
      result = {}
      for item in names_ages:
          name, age = item.split(' (')
          age = int(age.rstrip(')'))
          result[name] = age
      return result