class main:
def __init__(self, num1, num2, operator):
self.num1 = float(num1)
self.operator = operator
self.num2 = float(num2)
def mainfunc(self, operator, num1, num2):
while True:
if operator == "+":
return num1+num2
elif operator == "-":
return num1-num2
elif operator == "/":
return num1/num2
elif operator == "x" or "*":
print(int(num1)*int(num2))
break
p1 = main()
main.mainfunc(num1=input("Choose a number: "),
num2=input("Choose another number: "),
operator=input("Choose an operation: "))
我收到此错误 TypeError: main. init () 缺少 3 个必需的位置参数:'num1'、'num2' 和 'operator'