<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2722" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>Hi all,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I've got this program I've written that should give an addition quiz, 
except it never enters the quiz. How do I make it enter the quiz?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is the code:</DIV>
<DIV>import random</DIV>
<DIV>&nbsp;</DIV>
<DIV>def add(a,b):<BR>&nbsp;&nbsp;&nbsp; answer = a+b<BR>&nbsp;&nbsp;&nbsp; 
guess = float(raw_input(a," + ",b," = "))</DIV>
<DIV>&nbsp;</DIV>
<DIV>num1 = random.choice(range(1,10))<BR>num2 = 
random.choice(range(1,10))</DIV>
<DIV>&nbsp;</DIV>
<DIV>while 1:<BR>&nbsp;&nbsp;&nbsp; q = 
random.choice(range(15,31))<BR>&nbsp;&nbsp;&nbsp; cq = 1<BR>&nbsp;&nbsp;&nbsp; 
correct = 0<BR>&nbsp;&nbsp;&nbsp; while cq &gt;= 
q:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
add(num1,num2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if guess != 
answer:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
print "Incorrect! The correct answer is: 
",answer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
cq += 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elif guess == 
answer:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
print 
"Correct!"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
correct += 
1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cq += 
1<BR>&nbsp;&nbsp;&nbsp; else:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
print "Questions: ",q<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 
"Correct: ",correct<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "Percent 
Correct: ",(cq/q)*100<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break</DIV>
<DIV>&nbsp;</DIV>
<DIV>print "Goodbye."</DIV>
<DIV>&nbsp;</DIV>
<DIV>It just prints out for an example:</DIV>
<DIV>&nbsp;</DIV>
<DIV>Questions:&nbsp; 17<BR>Correct:&nbsp; 0<BR>Percent Correct:&nbsp; 
0<BR>Goodbye.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Nathan Pinno</DIV></BODY></HTML>