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!

Login and get coding
go back Intermediate level
Bitecoin 3X

Will you be Pythonista #63 to crack this Bite?
Resolution time: ~23 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 2.75 on a 1-10 difficulty scale.
» You can do it! 😌

We use Python 3.7