I have included validation in my code in order to ensure only a number can be entered. However when a negative number is entered, the negative number is not accepted by the program as a valid input. How can I solve this? The code is:
while QuestionNo != 11:
num1 = randint(0,10)
num2 = randint(0,10)
opp = choice(Operators)
Answer = (input(str(num1) + '' + (opp) + '' + str(num2) + '='))
while Answer.isdigit() == False:
print ('Please enter a number and nothing else.')
Answer = (input(str(num1) + '' + (opp) + '' + str(num2) + '='))
Thanks, John Smith