Feb-13-2019, 06:37 AM
Hi experts!
Any idea if I am making an error in my code as I am not able to understand Why Can't I call the the base class function for my derived class object?
Any idea if I am making an error in my code as I am not able to understand Why Can't I call the the base class function for my derived class object?
class My_base_class():
def __init__(self):
print("This is __init__function of Base Class")
def base_class_func1(self):
print("my base class function")
def base_class_func2(self):
print("my base class function # 2")
class My_derived_class():
def __init__(self):
My_base_class.__init__(self)
print("I am inside my __init__function of my Drived Class")
def base_class_func1(self):
print("my base class function")
def derived_class_func1(self):
print("I am inside my derived class function 01")
my_inherit=My_derived_class()
my_inherit.base_class_func2()# I get error while I call function of base class.Error:'My_derived_class' object has no attribute 'base_class_func2'
