I'm just starting to learn Python, and was writing a calculator program with two different files to get the concept of calling classes and functions down. The file with the mathmatical operations in a class looks as such:
class standardOpperations:
def __init__(self, primaryNumber, secondaryNumber):
primaryNumber.self = primaryNumber
secondaryNumber.self = secondaryNumber
def addition(self, primaryNumber, secondaryNumber):
print(primaryNumber, "+", secondaryNumber, "=", primaryNumber.self+secondaryNumber)
def subtraction(self, primaryNumber, secondaryNumber):
print(primaryNumber, "-", secondaryNumber, "=", primaryNumber-secondaryNumber)
def multiplication(self, primaryNumber, secondaryNumber):
print(primaryNumber, "*", secondaryNumber, "=", primaryNumber * secondaryNumber)
def division(self, primaryNumber, secondaryNumber):
print(primaryNumber, "/", secondaryNumber, "=", primaryNumber / secondaryNumber)
In a separate file, I tried to call this object (specifically the first function) in this line of code:
number01 = float(input("Please input a number here: "))
number02 = float(input("Please input a second number here: "))
addObj = standardOpperations.addition(number01,number02)
My issue is that upon running it, I get an error stating that I am missing a required potential argument, even though the function only uses two numbers. I'd really appreciate any help I can get in spotting my mistake, and helping the program work. Thanks all!