As a novice to Python myself, I encountered an error when trying to develop a Quiz program. I found that when the program generates two random numbers to add together, and the user attempts to enter in the correct values for the question, the program trips up and still prints that the input from the user is invalid.
def quiz():
print("The quiz will begin shortly")
print(numberone)
print("+")
print(numbertwo)
answerone=input("Answer:")
if answerone==(numberone + numbertwo):
print("Correct")
score+1
print("You're score is", score, ".")
else:
print("Incorrect")
print(numberone+numbertwo)
I do not understand what I am doing wrong, so any help would be much appreciated.
(NOTE: 'numberone' and numbertwo' are both defined)