73.2k views
5 votes
In python"Define a class Person and its two child classes: Male and Female. All classes have a method "getGender" which can print "Male" for Male class and "Female" for Female class."

User Taylonr
by
7.4k points

1 Answer

0 votes

Answer:

Step-by-step explanation:

class Person:

def getGender(self):

pass

class Male(Person):

def getGender(self):

print("Male")

class Female(Person):

def getGender(self):

print("Female")

User Ji Ra
by
7.2k points