Answer to Question #281753 in Python for Lewas

Question #281753

define a class named person with child classes named daughter and son who also have derived classes named grandson and granddaughter respectively

1
Expert's answer
2021-12-21T17:20:51-0500
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


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS