def aggregate_score(scores):
    score_dict = {}
    for entry in scores:
        # Split each entry into student and score
        words = entry.split()
        student = words[0]
        # Convert the score to an integer
        score = int(words[1])
        # If the name is already in the dictionary, add the score; otherwise, initialize it
        if student in score_dict:
            score_dict[student] += score
        else:
            score_dict[student] = score
    return score_dict


scores = ["Tom 5", "Lea 10", "Tom 7", "Lea 15"]
score_dict = aggregate_score(scores)
print(score_dict)
# {'Tom': 12, 'Lea': 25}