Hello great people of Codecademy,
Can you please help me this this error I’m getting on this very basic Calculator program, for some reason, out of the 4 methods I created, somehow ‘addition’ throws an error, all others work.
Here is the code:
calcmethod = input("What would you like to do today - Type add, sub, multi or divi:")
first_entry = int(input("Type your first entry:" ))
second_entry = int(input("Type your second entry:" ))
def __init__(self, n1, n2):
self.numberone = n1
self.numbertwo = n2
s = self.numberone+self.numbertwo
s = self.numberone-self.numbertwo
s = self.numberone*self.numbertwo
s = self.numberone/self.numbertwo
perform = Calculator(first_entry,second_entry)
if calcmethod == "add":
if calcmethod == "sub":
if calcmethod == "multi":
if calcmethod == "divi":
AND here is the error:
You have a floating classmethod decorater there. Removing it resolved the issue on my machine!
Hope this helps!
Best Answer, thanks, it worked, here I thought thats the most important line in the code, lol…