Answered step by step
Verified Expert Solution
Link Copied!

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

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

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_2

Step: 3

blur-text-image_3

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

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

Students also viewed these Databases questions

Question

Learn the principles of the scientific method

Answered: 1 week ago

Question

8-6 Who poses the biggest security threat: insiders or outsiders?

Answered: 1 week ago