how to print incorrect questions? : <p>I am making a quiz in python and i want to know how i can display the incorrect questions at the end of the quiz. For example i have a 10 question quiz and i get 3 wrong, so i want to those questions to be displayed in the program and give me the option to re take them.</p>

<p>Here is my code:</p>

<pre><code>correct=0
incorrect=0

def tryagain():
    while True:
       answer = input('Do you want to continue?:  Press Y for yes and N for no ')
       if answer.lower().startswith("y"):
          print()
       elif answer.lower().startswith("n"):
          exit()

print('****** Welceome to the Online Maths Test ********')
print()
print()
print()
print()
print()
print()
print()
import os
os.system("PAUSE")
import os
os.system('cls')
print('Question 1: 123 - 39 = ? \n 1. 64 \n 2. 44 \n 3. 74 \n 4. 84')
print()
answer=int(input())
if answer == 4:
        print ()
        print ()
        global correct
        correct=correct+1
elif answer != 4:
        print ()
        global incorrect
        incorrect=incorrect+1

import os
os.system('cls')
print('Question 2: 123+39 = ? \n \n 1. 162 \n 2. 166 \n 3. 62 \n 4. 66')
print()
answer=int(input())
if answer == 1:
        print ()
        print ()
        global correct
        correct=correct+1
elif answer != 1:
        print ()
        global incorrect
        incorrect=incorrect+1

import os
os.system('cls')
print('Question 3: 123*9 = ? \n 1. 1007 \n 2. 1107 \n 3. 1106 \n 4. 1116')
print()
answer=int(input())
if answer == 2:
        print ()
        print ()
        global correct
        correct=correct+1
elif answer != 2:
        print ()
        global incorrect
        incorrect=incorrect+1

import os
os.system('cls')
print('Question 4: 135 / 15 = ? \n 1. 8 \n 2. 8.5 \n 3. 9 \n 4. 9.5')
print()
answer=int(input())
if answer == 3:
        print ()
        print ()
        global correct
        correct=correct+1
elif answer != 3:
        print ()
        global incorrect
        incorrect=incorrect+1

import os
os.system('cls')
print('Question 5: 12 * (12 / 2) = ? \n 1. 144 \n 2. 6 \n 3. 72 \n 4. 36')
print()
answer=int(input())
if answer == 3:
        print ()
        print ()
        global correct
        correct=correct+1
elif answer != 3:
        print ()
        global incorrect
        incorrect=incorrect+1

import os
os.system('cls')
print('Question 6: 130 / 2 + 8 = ? \n 1. 13 \n 2. 14 \n 3. 61 \n 4. 84')
print()
answer=int(input())
if answer == 4:
        print ()
        print ()
        correct=correct+1
elif answer != 4:
        print ()
        global incorrect
        incorrect=incorrect+1

import os
os.system('cls')
print('Question 7: 10 + 12 + 13 * 6 / 2 = ? \n 1. 105 \n 2. 44 \n 3. 61 \n 4. 84')
print()
answer=int(input())
if answer == 3:
        print ()
        print ()
        global correct
        correct=correct+1
elif answer != 3:
        print ()
        global incorrect
        incorrect=incorrect+1

import os
os.system('cls')
print('Question 8: (10 + 12 + 13 * 6) / 2 = ? \n 1. 50 \n 2. 44 \n 3. 61 \n 4. 84')
print()
answer=int(input())
if answer == 1:
        print ()
        print ()
        global correct
        correct=correct+1
elif answer != 1:
        print ()
        global incorrect
        incorrect=incorrect+1

import os
os.system('cls')
print('Question 9: 8 (12 + 6 / 3 * 2) - 1 = ? \n 1. 127 \n 2. 109 \n 3. 95 \n 4. 135')
print()
answer=int(input())
if answer == 1:
        print ()
        print ()
        global correct
        correct=correct+1
elif answer != 1:
        print ()
        global incorrect
        incorrect=incorrect+1

import os
os.system('cls')
print('Question 10: 1 / 1 * 1 - 1 + 1 = ? \n 1. 1 \n 2. -1 \n 3. 0 \n 4. -2')
print()
answer=int(input())
if answer == 1:
        print ()
        print ()
        global correct
        correct=correct+1
elif answer != 1:
        global incorrect
        incorrect=incorrect+1
        print()
        print()
        print()
        print()
        import os
        os.system('cls')
        print('Your total score is: ',correct,' / 10')
        print('Your presentage is: ',correct*100/10,'%')
        print()
        print()
        print()
        print()
        tryagain()

tryagain()
</code></pre>
