-5
エラーは、関数からreturn right
は、したがって、エラーを動作しません後なぜこのelif文は構文エラーを返しますか?
File "Scantron.py", line 28
elif len(test_answers) != len(test_key):
^
SyntaxError: invalid syntax
コマンドが非ゼロの状態1
def grade_scantron(test_answers, test_key):
right = 0
for i in test_answers:
if test_answers[i] == test_key[i]:
right += 1
return right
elif len(test_answers) != len(test_key):
return -1
インデントライン27、 '場合はループ内right'返す' test_answers [i]を== test_key [i]の場合: ' –
してくださいコードにコンテキストを追加すると、if文全体を追加する必要があります。それに応じてあなたの質問をフォーマットしてください – chgsilva