所以我在 Python 上创建了一个程序,但我的一个模块有问题。这就是它的样子……
定义询问问题(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,而它不应该是。有谁知道我做错了什么?请帮忙...