Question: can someone help me with this These functions do not rely on rankings. ranked You can assume the incoming database could be either ranked or

can someone help me with this

can someone help me with this These functions do not rely on

These functions do not rely on rankings. ranked You can assume the incoming database could be either ranked or not find-all-years (db) This function accepts an existing database db, finds all years included m st 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 nane and a gender, adds all counts for that nane/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 fof either gender) with a count in the specified year and only information for that year The orniginal database must not be modified largestcount for year(db, year) accepts a database db, and a year. It finds the name/gender pairts) 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 nane (db, nane, gender, year, count, rank-None): This function accepts an existing datahase 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 upbdi. It's acceptable that there are some None ranks and some numeric ranks, so some calls to add, nane may intentionally use None as the rank If there is already an entry for that namegender/year, you must replace it. Hint: This function can be helpful to implement read file(), as well as any functions that must create a new database dictionary argument Function dealing with File Reading Thas is the ombhostionthatdolLuthAle reading you can attempt i, separate lhe hr h These functions do not rely on rankings. ranked You can assume the incoming database could be either ranked or not find-all-years (db) This function accepts an existing database db, finds all years included m st 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 nane and a gender, adds all counts for that nane/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 fof either gender) with a count in the specified year and only information for that year The orniginal database must not be modified largestcount for year(db, year) accepts a database db, and a year. It finds the name/gender pairts) 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 nane (db, nane, gender, year, count, rank-None): This function accepts an existing datahase 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 upbdi. It's acceptable that there are some None ranks and some numeric ranks, so some calls to add, nane may intentionally use None as the rank If there is already an entry for that namegender/year, you must replace it. Hint: This function can be helpful to implement read file(), as well as any functions that must create a new database dictionary argument Function dealing with File Reading Thas is the ombhostionthatdolLuthAle reading you can attempt i, separate lhe hr h

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!