Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PYTHON DEBUGGING HELP: PLEASE FIX THIS PROBLEM 5: Let's define a subclass of Book called PaperBook. PaperBook should inherit from Book and should add an
PYTHON DEBUGGING HELP: PLEASE FIX THIS
PROBLEM 5: Let's define a subclass of Book called PaperBook. PaperBook should inherit from Book and should add an instance variable called numTornPages, which is set to 0 in the constructor Add a method to the PaperBook class (NOT to the Book class) called ripPage , which increases numTornPages by 1 every time it is called In [43]: # define subclass here class PaperBook Book): def init_(self,title, author): self.numTornPages 0 super)._init(self) def ripPage (self): for x in self.numTornPages: self.numTornPages 1 In [44]: # manual test of subclass here last_lecture PaperBook ( 'The Last Lecture', 'Randy Pausch') print(last_lecture) Traceback (most recent call last) RecursionErrorStep 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