How to fix this iterative python code and reduce repetition?
<p>This snippet of code was supposed to generate a random number which represents a question. The number generator generates numbers from 1 through 10. But if the number is not in the list of numbers <code>"numlist"</code> it is supposed to generate another number. This is supposed to make it so that the program won't ask the same question twice. using <code>numlist.remove()</code> did not work for this purpose. What will work? Or, what is a better method.</p>

<p>Also, I want to know how to make it so that there is less repetition in the code (loop?).</p>

<pre><code>def roll():
    var = random.randint(1,10)
    if var not in numlist:
        roll()

    elif var == 1:
        numlist.remove(1)
        q1()
    elif var == 2:
        numlist.remove(2)
        q2()
    elif var == 3:
        numlist.remove(3)
        q3()
    elif var == 4:
        numlist.remove(4)
        q4()
    elif var == 5:
        numlist.remove(5)
        q5()
    elif var ==6:
        numlist.remove(6)
        q6()
    elif var == 7:
        numlist.remove(7)
        q7()
    elif var == 8:
        numlist.remove(8)
        q8()
    elif var == 9:
        numlist.remove(9)
        q9()
    elif var == 10:
        numlist.remove(10)
        q10()
</code></pre>
