Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programming language - python c. read_files() Write code for read_files() which takes a list of filenames, building and returning a names dict of all their
Programming language - python
c. read_files() Write code for read_files() which takes a list of filenames, building and returning a names dict of all their data. This function is called by main() to build up the names dict from all the files mentioned on the command line. No tests are required this short function. d. search_names() Write code for search_names() which searches for a target string and returns a sorted list of all the name strings that match the target (no year or rank data). In this case, the target matches a name, not-case sensitive, if the target appears anywhere in the name. For example the target strings 'aa' and 'AA' both match 'Aaliyah' and 'Ayaan'. Return the empty list if no names match the target string. This function is called by main() for the - search command line argument. Write at least 3 Doctests for search_names() which is the most algorithmic. You can make up a tiny names dict just for the tests. def read_files(filenames.): Given list of filenames, build and return a names dict of all their data. pass edef search_names(names, target): Given names dict and a target string, return a sorted list of all the name strings that contain that target string anywhere. Not case sensitive. (Code and tests TBD) pass 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