Question 3.
For this question, you need to work with text. Write a function that takes in two text files: one is a book, and another file has names in it. You need to determine the three most popular names in the book (from the given name list). To do this, implement two helper methods: name_count and make_tuple, that will assist you in finding the answer.
```python
def name_count(file, name):
# Function returns the number of names in the file that match the given name.
# Example usage: name_count("little_women.txt", "Jo") -> 1543
# Example usage: name_count("little_women.txt", "Meg") -> 685
# Example usage: name_count("little_women.txt", "Troll") -> 0
# YOUR CODE HERE #
def make_tuple(name, freq):
# Function returns a tuple of two inputs.
# Example usage: make_tuple(5, 3) -> (5, 3)
# Example usage: make_tuple(2, 2) -> (2, 2)
# Example usage: make_tuple('red', 5) -> ('red', 5)
# YOUR CODE HERE #
def three_most_common_names(text, text_names):
# Function that takes in text (a book) and text names (characters from the book).
# You must implement this function to find the three most common names in the book.
# Example usage: three_most_common_names("little_women.txt", "names.txt") -> ['Jo', 'Meg', 'Amy']
# YOUR CODE HERE #
```