Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using python Question 3 For this question you need to work with text. Write a function that takes in a two text files: one is
Using python
Question 3 For this question you need to work with text. Write a function that takes in a two text files: one is a book, another file has names in it. You need to determine the 3 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. def namecount (file, name): Function returns the number of names in ile that match the given name >>name count("little women.txt", "Jo" 1543 >name count("little women.txt","Meg") 685 >name_count("littlewomen.txt", "Troll") # YOUR CODE HERE # def make tuple (name, frea): Function returns a tuple of two inputs >>make tuple (5, 3) (S, 3) >>make tuple (2, 2) (2, 2) >>make_tuple('red', 5) ('red', 5) YOUR CODE HERE def three_most_common names (text, text_names): Function that takes in text (a boak) and text names (characters from the baok You must implement this function to find the three most common names in the book >>> three most common names ("little women.txt" "names.txt") Jo', 'MegAmy' # YOUR CODE HERE #Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started