in python is a mathematical operator classed as an interger. for example why isnt this code working
import random
score = 0
randomnumberforq = (random.randint(1,10))
randomoperator = (random.randint(0,2))
operator = ['*','+','-']
answer = (randomnumberforq ,operator[randomoperator], randomnumberforq)
useranswer = input(int(randomnumberforq)+int(operator[randomoperator])+ int(randomnumberforq))
if answer == useranswer:
print('correct')
else:
print('wrong')
See Question&Answers more detail:os