I have created 3 classes which are as follows:
- A having a1,a2 as class vairiables
- B(A) A is the parent for B, having b1,b2 as class Variables
- C(B) B is the parent for C, having c1, c2 as the class Variables
I am trying to create an Object for the C(B) class by typing:- obj = C(1,2)
But I am not able to access the class A, B variables (a1,a2,b1,b2) using the object created from the C class.
class A:
def __init__(self,a1,a2):
self.a1 = a1
self.a2 = a2
def testa():
print('inside A')
class B(A):
def __init__(self,b1,b2):
self.b1 = b1
self.b2 = b2
def testb():
print('inside B')
class C(B):
def __init__(self,c1,c2):
self.c1 = c1
self.c2 = c2
def testc():
print('inside C')
obj = C(1,2)