Answered step by step
Verified Expert Solution
Link Copied!

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 pythonimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Science For Dummies

Authors: Lillian Pierson ,Jake Porway

2nd Edition

1119327636, 978-1119327639

More Books

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago

Question

Identify how culture affects appropriate leadership behavior

Answered: 1 week ago