class A:
def __init__(self):
self.a=10
def bvalue(self):
self.b=20
def add1(self):
c=self.a+self.b
print(c)
a1=A()
a1.add1()
ouput
AttributeError: 'A' object has no attribute 'b'
Im decalring a=10 inside init mehthod and declaring b=20 inside another method, and using 3rd method im trying to add a+b. but why it's giving error? am i making any mistakes here?