Question: For the base class Person example provided in the tutorial, if we need to add a subclass for kids on site who attend the daycare
For the base class Person example provided in the tutorial, if we need to add a subclass for kids on site who attend the daycare in which we keep track of their primary parent, what code segment could implement this subclass and create an instance of it called kid
a
class Daycarekid:
def self fname, Iname, title, parent:
self.parent parent
def getparentself:
return "Parent: strselfparent
def setparentself parent:
self. parent parent
kid DaycareKidJohnny 'Doe', 'kid', 'Jane Doe'
b
class DaycarekidPerson:
def self fname, lname title, parent:
superfname lnametitle
self.parent parent
def getparentself:
return "Parent: strselfparent
def setparentself parent:
self. parent parent
kid DaycareKidJohnny 'Doe', 'kid', 'Jane Doe'
c
class DaycarekidPerson:
def self fname, lname title, parent:
superfname Iname
self.parent parent
def getparentself:
return "Parent: strselfparent
def setparentself parent:
self. parent parent
kid Daycarekid Johnny', 'Doe', 'kid', 'Jane Doe'
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
