How can I create a quiz in Python using a dictionary rather than a large number of if/else statements?
<p>I'm making a quiz of yes/no questions where answering yes/no depending on the question rewards a different amount of points, which after each question will be added to a total and displayed at the end.</p>

<p>However, there are around 50 questions in the quiz, and this would mean a mountain of if/else statements. Is there a way I can use a dictionary and a loop or something similar to significantly reduce the length of the program?</p>

<p><em>edit</em> This repeated many times is what I'm trying to avoid. I'm thinking of adding a variable i and adding 1 to it after each question, and looking up the index of the next question. But is this only possible with a list?</p>

<pre><code>print "The following are y/n questions."
total = 0 

q1 = raw_input("Do you exercise daily? ")
if q1 == "y":
    total += 1
else:
    total = total

print total
</code></pre>