Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Hostgator 1 Penny

BlueHost Web Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Distribute your Resume to 500+ Job Boards & Recruiters


7,586 questions

10,629 answers

573 users

How to use multiple inheritance using super() in Python

1 Answer

0 votes
class A:
    def m(self):
        print("class A: m(self)")


class B(A):
    def m(self):
        print("class B: m(self)")
        super().m()


class C(A):
    def m(self):
        print("class C: m(self)")
        super().m()


class D(B, C):
    def m(self):
        print("class D: m(self)")
        super().m()

do = D()
do.m()

 
'''
run:
 
class D: m(self)
class B: m(self)
class C: m(self)
class A: m(self)
 
'''

 




answered Feb 12 by avibootz
...