About random.shuffle, arrays
<p>Hi there so I have this code. It works well (has also taught me alot about Python as I am new and a bit of a beginner but catching up very well.) Anyway I want to shuffle the questions in the following code. I understand the idea of random.shuffle and arrays. Just not sure howto put it together and what fits best</p>

<pre><code>def game():                                                                                         #defines the games script
    start_time = time.time()                                                                        #starts game timer.
    correct = 0                                                                                     #recalls amount of correct questions.
    wrong = 0
    time.sleep(2)                                                                                  #sleep function pauses game for 2 seconds.
    list1 = ["10","7","13","4","1","6","9","12","17","2"]                                           #list of answers, if statements check answer for each question. i.e: 1 number = answer for 1 question.

    print "\nQuestion 1:\n"                                                                         #printed text.
    print "First question: _ - 8 = 2"                                                               #prints user question.
    print "a, 10"                                                                                   #prints question hint.
    print "b, 9"                                                                                    #prints question hint.
    print "c, 13"                                                                                   #prints question hint.
    list1 = raw_input("Your answer:  ")                                                             #asks user to input answer.
    if list1 == "10":                                                                               #checks list above for answer.
        correct += 1                                                                                #adds 1 to correct total.
        print "\n\t  Wonderful, correct",list1,"- 8 = 2\n"                                          #printed text.
    else:                                                                                           #if not correct, else checks and chooses wrong.
        wrong +=1                                                                                   #adds 1 to wrong total.
        print "\n\tSorry you got that number wrong. The correct number was 10\n"                      #printed text.
</code></pre>

<pre><code>def game():                                                                                         #defines the games script
    start_time = time.time()                                                                        #starts game timer.
    correct = 0                                                                                     #recalls amount of correct questions.
    wrong = 0
    time.sleep(2)                                                                                  #sleep function pauses game for 2 seconds.
    list2 = ["\nQuestion 1", "\nQuestion 2", "\nQuestion 3", "\nQuestion 4", "\nQuestion 5", "\nQuestion 6", "\nQuestion 7", "\nQuestion 8", "\nQuestion 9", "\nQuestion 10",]
    list3 = ["_ - 8 = 2", "_ - 4 = 3", "20 - _ = 7", "11 - 7 = _", "5 - _ = 4", "19 - 13 = _", "_ - 7 = 2", "17 - 5 = _", "_ - 6 = 11", "15 - 13 = _"]
    ans = ["10","7","13","4","1","6","9","12","17","2"]                                           #list of answers, if statements check answer for each question. i.e: 1 number = answer for 1 question.
    ans2 = ["10 - 8 = 2", "7 - 4 = 3", "20 - 13 = 7", "11 - 7 = 4", "5 - 1 = 4", "19 - 13 = 6", "9 - 7 = 2", "17 - 5 = 12", "17 - 6 = 11", "15 - 13 = 2"]
    op = list(zip(list3, ans, ans2))                                                              #zips operations to be randomly unzipped.
    random.shuffle(op)                                                                      #shuffles the questions out of order everytime
    list3, ans, ans2 = zip(*op)                                                                   #sets op as zip * is used to unzip

    print list2[0]                                                                        #printed text.
    print list3[0]                                                               #prints user question.
    op = raw_input("Your answer:  ")                                                             #asks user to input answer.
    if op == ans[0]:                                                                               #checks list above for answer.
        correct += 1                                                                                #adds 1 to correct total.
        print "\n\t  Wonderful, correct",ans2[0],"\n"                                      #printed text.
    else:                                                                                           #if not correct, else checks and chooses wrong.
        wrong +=1                                                                                   #adds 1 to wrong total.
        print "\n\tSorry you got that number wrong.",ans2[0],"\n"                      #printed text.
</code></pre>

python random