Bite 199. Multiple inheritance (__mro__)

Implement the following class structure: print(Child.__mro__):

(<class '__main__.Child'>,
 <class '__main__.Father'>,
 <class '__main__.Mother'>,
 <class '__main__.Person'>,
 <class 'object'>)

Each class has the following string representation:

person = Person()
dad = Father()
mom = Mother()
child = Child()

print(person)
print(dad)
print(mom)
print(child)

Output:

I am a person
I am a person and cool daddy
I am a person and awesome mom
I am the coolest kid

You should use inheritance here, so the I am a person substring should only occur in the Person base class.

Good luck and keep calm and code in Python!

7 out of 8 users completed this Bite.
Will you be Pythonista #8 to crack this Bite?

Login and get coding
We use Python 3.7