input: def create_dict_from_list(names_ages: List[str]) -> dict:
      """
      Creates a dictionary from a list of names and ages. Each element in the list should be a string in the format "Name (Age)".
  
      >>> create_dict_from_list(['John (20)', 'Jane (40)', 'Alex (18)', 'Peter (45)'])
      {'John': 20, 'Jane': 40, 'Alex': 18, 'Peter': 45}
      """
output:     result = {}
      for item in names_ages:
          name, age = item.split(' (')
          age = int(age.rstrip(')'))
          result[name] = age
      return result