ARTICLE AD BOX
Atempt = 0
validinput = False
while validinput == False:
if Atempt > 0:
print('Your choice is Invalid. enter a Operation from the choices given')
opps = input('What Operation would you like to do (+ - / * )')
choices = ["+","/","-","*"]
if opps in choices:
validinput = True
Number1 = input("Your first number")
Number2 = input(" your second number")
if opps == "+":
result = int(Number1) + int(Number2)
elif opps == "-":
result = int(Number1) - int(Number2)
elif opps == "/":
result = int(Number1) / int(Number2)
elif opps == "*":
result = int(Number1) * int(Number2)
print(result)
else:
Atempt = Atempt + 1
That's my code, the actual calculator part works but when the user inputs an invalid operation I want it to print that your choice is invalid text but it doesn't, it sends, as you can see in the image at the bottom. it just keeps repeating the input every time i enter something not valid.
