Question: find_all years (db) : This function accepts an existing database db, finds all years included in it anywhere. Return the list of years sorted in

 find_all years (db) : This function accepts an existing database db,

find_all years (db) : This function accepts an existing database db, finds all years included in it anywhere. Return the list of years sorted in ascending order. total count_for_name (db, name, gender) : This function accepts an existing database db, a name and a gender, adds all counts for that name/gender from different years and returns the total. . names_by_ year(db, year): accepts a database db, and a year. It builds/returns a new database with only names (of either gender) with a count in the specified year and only information for that year. The original database must not be modified. . largest count_for_year(db, year): accepts a database db, and a year. It finds the name/gender pair(s) with the highest count in that year and returns as a list of tuples (name, gender, count). Since multiple name/gender pairs might tie with the highest count, sort the list alphabetically with .sort() or sorted() . add_name (db, name, gender, year, count, rank-None): This function accepts an existing database db, name, gender, year, count, and rank then it updates the database to include that information . Return None. The resulting database is considered unranked, as the addition means the rankings aren't up-to-date It's acceptable that there are some None ranks and some numeric ranks, so some calls to add name may intentionally use None as the rank argument . If there is already an entry for that name/gender/year, you must replace it. . Hint: This function ca n be helpful to implement read file(), as well as any functions that must

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!