Basically, I'm reading input from the user, and checking if it's equivalent to a value I've stored.
num1 = random.randrange(0, 10, 1); num2 = random.randrange(0, 10, 1); answer = num1 * num2
'answer' is the value I'm checking user input against.
input_var = input("? ")
I get input using the... well, input function? (I'm assuming this is the correct way to retrieve user input interactively, however if not, please enlighten me!!)
if input_var == answer:
When checking for equality this way, even if the number the user input is the same number as what was stored in 'answer', the program always enters the 'else:' clause instead.
I'm not sure what's going on, I've printed out both 'input_var' and 'answer' and they display the same number (assuming the user inputs the same number).
Any help would be greatly appreciated.