我不能完全让这个 python 程序工作,每次我运行它时,它都会在第 25 行出现“缩进中制表符和空格的不一致使用”错误,这是“else”循环。我尝试了各种方法来解决这一切都无济于事,所以想知道是否有人可以解释我的问题。非常感谢您的时间。
questions = ["What does RAD stand for?",
"Why is RAD faster than other development methods?",
"Name one of the 3 requirements for a user friendly system",
"What is an efficient design?",
"What is the definition of a validation method?"]
answers = ["A - Random Applications Development, B - Recently Available Diskspace, C - Rapid Applications Development",
"A - Prototyping is faster than creating a finished product, B - Through the use of CASE tools, C - As end user evaluates before the dev team",
"A - Efficient design, B - Intonated design, C - Aesthetic design",
"A - One which makes best use of available facilities, B - One which allows the user to input data accurately, C - One which the end user is comfortable with",
"A - A rejection of data which occurs because input breaks predetermined criteria, B - A double entry of data to ensure it is accurate, C - An adaption to cope with a change external to the system"]
correctanswers = ["C", "B", "A", "A", "A"]
score = 0
for i in range(len(questions)):
a = 1
print (questions[a])
print (answers[a])
useranswer = (input("Please enter the correct answer's letter here:"))
correctanswer = correctanswers[a]
if useranswer is correctanswer:
print("Correct, well done!")
score = score + 1
else:
print("Incorrect, sorry!")
print("Well done, you scored" + score + "//" + int(len(questions)))