def interpret(result : [None]) -> str:
s = ''
s = s + 'Start state = ' + result[0] +'\n '
for x in result[1:-1]:
s += ' Input = ' + x[0]+ '; new possible states = ' + str(sorted(x[1])) + '\n '
s = s + ' Input = ' + x[0]+ '; new possible states = ' + str(sorted(result[-1][1])) + '\n'
s = s + 'Stop state(s) = ' + str(sorted(result[-1][1]))
return s
evaluated: Start state = start
Input = 1; new possible states = ['start']
Input = 0; new possible states = ['near', 'start']
Input = 1; new possible states = ['end', 'start']
Input = 1; new possible states = ['start']
Input = 0; new possible states = ['near', 'start']
Input = 0; new possible states = ['end', 'start']
Stop state(s) = ['end', 'start'] == Start state = start
Input = 1; new possible states = ['start']
Input = 0; new possible states = ['near', 'start']
Input = 1; new possible states = ['end', 'start']
Input = 1; new possible states = ['start']
Input = 0; new possible states = ['near', 'start']
Input = 1; new possible states = ['end', 'start']
Stop state(s) = ['end', 'start']
31 *エラーを出力と一致しません。文字列を正しい形式で返す必要があります。 出力は正しい出力と同じですが、エラーが出ます。誰かがなぜそれが正しくないのか教えてもらえますか?多くの入力が['start', ('1', {'start'}), ('0', {'start', 'near'}), ('1', {'end', 'start'}), ('1', {'start'}), ('0', {'start', 'near'}), ('1', {'end', 'start'})]
で、正しい出力は方法によって感謝
「」状態を開始します= \ nは入力= 1を起動し、新しい可能性のある状態= [ 『スタート』] \ nは入力= 0;新しいです\ n入力= 1;新しい可能な状態= ['開始'] \ n入力= 1、新しい可能な状態= ['終了'、 '開始' 0、新しい可能な状態= ['近く'、 '開始'] \ n入力= 1;新しい可能な状態= ['終了'、 '開始'] \ n停止状態= ['終了'、 '開始'] \ n "
私は得た結果を示すために写真を追加しました。
はSOへようこそ。あなたは、あなたが求めていることを理解できる十分な情報を提供していません。 [最小限の、完全で検証可能な例]を提供してください(http://stackoverflow.com/help/mcve)。また、[How to ask](http://stackoverflow.com/help/how-to-ask)も読んでください。 – CAB