February 24th, 2013, 09:33 PM
Join Date: Feb 2013
Time spent in forums: 11 m 6 sec
Reputation Power: 0
I've been working on a particular math-quiz game as an introductory project to python scripting. In this program, I use strings of random integers to create new problems every time a question comes up.
However, in one of these chains, the if-then statement that dictates what the program will do depending on if an answer is right or wrong has been malfunctioning. The statement completely bypasses the "correct" option and goes to the "incorrect" route (these are not hard either, its painfully obvious like 8+5=? questions)
The program piece that is malfunctioning looks like this:
print ('Question 2' + str (Qb) +' + ' + str (Qbb) + ' = ?')
Qbaa = Qb + Qbb
if Qba == ('Qbaa'):
print ('Correct! + 25 to score!')
Score = Score + 25
What is causing the correct path to be bypassed?