Time To Code
Get hands-on practice by coding a few programming tasks.
Task I: Total number of books by an author
Our task is to find the total number of books written by specific authors.
✏️ Note: Below is the same code we saw in the previous lesson to read the dataset as objects of book class. Write the piece of code to answer the questions below.
It takes the name of an author and dataset as input and returns the total number of books written by the author.
Input: J.K. Rowling
Expected output:
Total number of books by J.K. Rowling: 6
Just for reference, Author
is the second column in the dataset
.
Get hands-on with 1200+ tech skills courses.