am trying to make a simple calculator using python but for some reason he keep giving me the same result everytime
here is the code
def inputing(num2, op) :
op = input("operator")
num2 = int(input("number"))
def calculing(num1,num2,op):
if op == "+":
num1 += num2
print(num1)
elif op == "-":
num1 -= num2
print(num1)
elif op == "*":
num1 *= num2
print(num1)
elif op == "/":
num1 /= num2
print(num1)
elif op == "=":
print(num1)
else:
print("error")
repeat=True
class calcul():
num1 = int(input("number"))
op = input("operator")
while op == "=":
print(num1)
op = input("operator")
num2 = int(input("number"))
while repeat==True:
calculing(num1,num2,op)
inputing(num2,op)
i want to take the first result and as the number1 then add the number2 to him and keep repeating that but here the result in console:
number:5
operator:+
number:5
10
operator:+
number:5
10