When I run the below code, I get
AttributeError: monster instance has no attribute 'D'
What would I have to change so that Godzilla.D would return (in this case, with 2,3 as the params) 7?
def add(x):
y = x + 1
return y
class monster:
def __init__(self, A, B):
self.A = A
self.B = B
C = A * B
D = add(C)
Godzilla = monster(2,3)
Godzilla.D