Python:Each function will read the google_books_dataset.csv file (the file name will be the only input parameter of the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Python:Each function will read the google_books_dataset.csv file (the file name will be the only input parameter of the

Post by answerhappygod »

Python:Each function will read the google_books_dataset.csv file
(the file name will be the only input parameter of the function).
Use the function design recipe to develop a function named
get_books_by_rate. The function has two input parameters, (1) the
dictionary where the data is stored and (2) a positive integer
argument which is the rate. The function returns the number of
books (note that the same book in a different category counts as a
single book) for the given rate. For example, if the input
parameter for the rate is 3. The function will return the number of
books whose rate is greater or equal to 3 and smaller than 4.
Additionally, it will print the information of all the books for
the given rate as follows: There are xxx books whose rate is
between zzz and yyy. This is the list of books: Book 1: "Title" by
"Author" Book 2: "Title" by "Author" .... You cannot use any
external libraries other than: “import string” and “from typing
import List”. You can treat a csv file as a text file; just open it
with Notepad instead of Excel to check it out.
Please provide examples, docstring.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply