I'm doing a project in flask in which I already have about 50 classes with different functionalities, and when I try to return the value of a method in another class I get the error like the following:
AttributeError: 'str' object has no attribute 'value_one'
but if I remove the variables the .self for example, I rename the variable self.value_one to value_one if it works. the issue is that I do not know how to make using the method add in the print_Maths_Operations class, I return the calculated value without having to modify all the variables in the code. the example below represents the flaw in question that I have in several classes of the project
class Maths_Operations():
def __init__(self):
self.value_one = 0
self.value_two = 0
self.total = 0
def add(self, x,y):
self.value_one = x
self.value_two = y
self.total = self.value_one + self.value_two
return self.total
class print_Maths_Operations():
print(Maths_Operations.add("",4,8))