I'm Using Python 3.4. I receive the error:
Traceback (most recent call last):
File "H:/GCSE's/Computing/Assesment/1/School Grading Script.py", line 44, in <module>
if answer== eval(num1<currentop>num2):
TypeError: unorderable types: int() < str()
when trying to execute this code
operator=["+","-","*"]
num1=random.randint(0,10)
num2=random.randint(0,10)
currentop=random.choice(operator)
answer = input("What is " + str(num1) + str(currentop) + str(num2) + "?\n")
if answer== eval(num1<currentop>num2):
print("correct")
else:
print(incorrect)
What I want to do is to check the answer against the randomly generated variables