I'm trying to make a quiz using Python 3. The quiz randomly generates two separate numbers and operator. But when I try to get the user to input their answer, this shows up in the shell:
<class 'int'>
I'm not sure what I need to do. Even if I type in the correct answer, it always returns as incorrect.
import random
import operator
operation=[
(operator.add, "+"),
(operator.mul, "*"),
(operator.sub, "-")
]
num_of_q=10
score=0
name=input("What is your name? ")
class_name=input("Which class are you in? ")
print(name,", welcome to this maths test!")
for _ in range(num_of_q):
num1=random.randint(0,10)
num2=random.randint(1,10)
op,symbol=random.choice(operation)
print("What is",num1,symbol,num2,"?")
if input(int)==(num1,op,num2):
print("Correct")
score += 1
else:
print("Incorrect")
if num_of_q==10:
print(name,"you got",score,"/",num_of_q)
if int(input('Enter the number: '))==(num1,op,num2):?