dont repeat yourself!, create methods, add your question and the excepted answer as flag
import time
def create_question(question = "", answer = "", excepted = ""):
print (question)
time.sleep(7)
print(answer)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer
")
if response == excepted:#CHANGE
print ("Correct!
")
break
else:
print("Incorrect!!! Try again.")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer
")
if response == excepted:#CHANGE
print ("Correct!
")#CHANGE
stop = True
break
else:
print("Incorrect!!! The Tornado GR4 is based at RAF Marham
")#CHANGE
stop = True
break
if stop:
break
#first question
create_question(question = "Where is the Tornado GR4 based?",
answer = "a. RAF Marham
b. RAF Conningsby
c. RAF Waddington
d. RAF Church Fenton
",
excepted = "a")
#second question
create_question(question = "Where is the Typhoon FGR4 Based?",
answer = "a. RAF Marham
b. RAF Conningsby
c. RAF Benson
d. RAF Wyton
",
excepted = "b")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…