This probably is a really dumb question but when I type an answer, It is the correct answer, but it still says "incorrect, the answer is....." then prints out the answer I typed to begin with, so it isn't assigning 'rightanswer' to answer'. help?? (this is the newer version of python so the parenthesis are needed)
import random
ops = ['+', '-', '*', '/']
num1 = (random.randint(1,10))
num2 = (random.randint(1,10))
operation = (random.choice(ops))
maths = (num1, operation, num2)
print (maths)
answer = input("what is the answer to the above sum?")
if operation == "/":
CorrectAnswer = (num1/num2)
elif operation == "*":
CorrectAnswer = (num1*num2)
elif operation == "-":
CorrectAnswer = (num1-num2)
else:
CorrectAnswer = (num1+num2)
time.sleep(1)
if answer == CorrectAnswer:
print ("correct!")
else:
print ("incorrect, the answer is", CorrectAnswer)