dont repeat yourself!、メソッドを作成し、あなたのコードを手直しし、アレイまたは外部ファイルに質問を配置する必要がありますフラグ
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\n")
if response == excepted:#CHANGE
print ("Correct!\n")
break
else:
print("Incorrect!!! Try again.")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == excepted:#CHANGE
print ("Correct!\n")#CHANGE
stop = True
break
else:
print("Incorrect!!! The Tornado GR4 is based at RAF Marham\n")#CHANGE
stop = True
break
if stop:
break
#first question
create_question(question = "Where is the Tornado GR4 based?",
answer = "a. RAF Marham\nb. RAF Conningsby\nc. RAF Waddington\nd. RAF Church Fenton\n",
excepted = "a")
#second question
create_question(question = "Where is the Typhoon FGR4 Based?",
answer = "a. RAF Marham\nb. RAF Conningsby\nc. RAF Benson\nd. RAF Wyton\n",
excepted = "b")
として、あなたの質問と答え除外を追加します。 –
[最小、完全、検証可能な例](http://stackoverflow.com/help/mcve)を作成して質問に追加してください。 –