class A: def getA(self): return 1class B: a = A() def getB(self): return 2 * self.a.getA()class C(B): def getC(self): return self.a.getA()c = C()print(c.getC())
Reference
https://www.geeksforgeeks.org/python-call-parent-class-method/
No comments :
Post a Comment