from random import randint
def checkAddition( a, b ):
ans = int(raw_input("What is %d + %d ? " % (a,b)))
if ans == a + b:
x = randint(1,100)
y = randint(1,100)
This is code that simply checks addition but now I have to embed function in a loop generating 2 random numbers between 1 & 100. counting both total no. of questions & no. of correct responses and also continue loop if you wish or exit if not ..
Any help guys Really appreciated ,,