Question
IN PYTHON ADD THE FOLLOWING TO THE LIBRARY CLASS getBooksYouCanCheckOut (no arguments besides self): - Return a list of every book in the library that
IN PYTHON
ADD THE FOLLOWING TO THE LIBRARY CLASS
getBooksYouCanCheckOut (no arguments besides self): - Return a list of every book in the library that can be checked out. Books should be in the same order in which they were added to the library.
class Library: def __init__ (self): self.books = [] self.tornPageTolerance = 10 def addBook(self, book): self.books.append(book) def findBooksBy(self,author): found = [] for book in self.books: if book.author == author: found.append(book) return found def willAccept(self, book): isit = isinstance(book,PaperBook) if isit == True: if book.numTornPages < self.tornPageTolerance: return True else: return True
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started