if op == '+':
left1 = random.randint(1,100)
right1 = random.randint(1,100)
print ("What is " + (str(left1) + op + str(right1) + "?"))
answer = eval(str(left1) + op + str(right1))
guess = int(input(""))
if guess == answer:
print("Correct!")
score + 1
elif guess != answer:
print("Incorrect")
else:
except ValueError:
print("Expected integer")
I tried except ValueError, but it stated that it was invalid syntax. I'm trying to get the code to force the user to enter an integer for the answer, if they don't then it tells them that they are supposed to enter an integer.