How to use super function in class with inheritance with in Python

1 Answer

0 votes
class classA(object):     
    def methodA(self):
        print("methodA")

class classB(classA):
    def methodB(self):
        super().methodA()
        
obj = classB()

obj.methodB()




'''
run:

methodA

'''

 



answered Apr 28, 2021 by avibootz

Related questions

1 answer 234 views
1 answer 194 views
1 answer 146 views
1 answer 181 views
...