GH avatar 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!

26 out of 26 users completed this Bite.
Will you be Pythonista #27 to crack this Bite?
It takes an average of ~26 minutes to solve this Bite (submissions 5-240 min).
Pythonistas rate this Bite 2.67 on a 1-10 difficulty scale.
» You can do it! 😌

Buy Now Login and get coding
We use Python 3.7