How to use super() to call the parent class in Python

1 Answer

0 votes
class A:
    def name(self):
        print("c a")


class B(A):
    def name(self):
        print("c b")
        super().name()

o = B()
o.name()


'''
run:
 
c b
c a

'''

 



answered Nov 16, 2018 by avibootz

Related questions

...