Oct-31-2018, 01:35 AM
Hi,
I just want to understand, why I'm getting below error in inheritance?
I just want to understand, why I'm getting below error in inheritance?
Error:Traceback (most recent call last):
File "inheritance.py", line 13, in <module>
main()
File "inheritance.py", line 10, in main
print b_obj.aa
AttributeError: 'B' object has no attribute 'aa'This is my python codeclass A(object):
def __init__(self):
self.aa = None
class B(A):
def __init__(self):
self.bb = None
def main():
b_obj = B()
print b_obj.aa
if __name__ == '__main__':
main()
