define a class named person with child classes named daughter and son who also have derived classes named grandson and granddaughter respectively
class Person:
def __init__(self, name):
self.name = name
def say_hi(self):
print("Hello,", self.name)
class Son(Person):
pass
class Daughter(Person):
pass
Comments
Leave a comment