Pythonでプログラムを作成していますが、モジュールの1つに問題があります。これはそれがどのように見えるかです...
def askQuestions(aQ):
answer = "nothing"
while answer not in("Yes", "yes", "Y", "y", "YES", "No", "no", "N", "n", "NO"):
if answer in("Yes", "yes", "Y", "y", "YES"):
aQ = aQ + Score[0]
answer = input(Questions[1])
answer = "nothing"
while answer not in("Yes", "yes", "Y", "y", "YES", "No", "no", "N", "n", "NO"):
if answer in("Yes", "yes", "Y", "y", "YES"):
aQ = aQ + Score[1]
answer = input(Questions[2])
answer = "nothing"
while answer not in("Yes", "yes", "Y", "y", "YES", "No", "no", "N", "n", "NO"):
if answer in("Yes", "yes", "Y", "y", "YES"):
aQ = aQ + Score[2]
answer = input(Questions[3])
answer = "nothing"
while answer not in("Yes", "yes", "Y", "y", "YES", "No", "no", "N", "n", "NO"):
if answer in("Yes", "yes", "Y", "y", "YES"):
aQ = aQ + Score[3]
answer = input(Questions[4])
answer = "nothing"
while answer not in("Yes", "yes", "Y", "y", "YES", "No", "no", "N", "n", "NO"):
if answer in("Yes", "yes", "Y", "y", "YES"):
aQ = aQ + Score[4]
answer = input(Questions[5])
answer = "nothing"
while answer not in("Yes", "yes", "Y", "y", "YES", "No", "no", "N", "n", "NO"):
if answer in("Yes", "yes", "Y", "y", "YES"):
aQ = aQ + Score[5]
answer = input(Questions[6])
answer = "nothing"
while answer not in("Yes", "yes", "Y", "y", "YES", "No", "no", "N", "n", "NO"):
if answer in("Yes", "yes", "Y", "y", "YES"):
aQ = aQ + Score[6]
answer = input(Questions[7])
answer = "nothing"
while answer not in("Yes", "yes", "Y", "y", "YES", "No", "no", "N", "n", "NO"):
if answer in("Yes", "yes", "Y", "y", "YES"):
aQ = aQ + Score[7]
answer = input(Questions[8])
answer = "nothing"
while answer not in("Yes", "yes", "Y", "y", "YES", "No", "no", "N", "n", "NO"):
if answer in("Yes", "yes", "Y", "y", "YES"):
aQ = aQ + Score[8]
answer = input(Questions[9])
return aQ
適切な入力が与えられていない場合に、質問を繰り返すという意味で機能します。しかし、それは加算されません....だから、aQ を返すと、0 になるべきではありません。私が間違っていることを誰かが知っていますか?助けてください...