이 책의이 시점에서 기능을 호출하는 작은 비디오 게임을 만들도록하는 책을 살펴 보겠습니다. if
, while
의 - 모든 것 지금까지 책에서 다루어졌다. 하지만이 코드에서이 오류가 발생합니다.구문 및 들여 쓰기 오류에 대한 문제
코드가 편집되었으며 새로운 오류가 나타납니다. 여기
File "ex35_study.py", line 24 third_scenario_code() IndentationError: unindent does not match any outer indentation level
내 코드입니다 :options_thirdscenario_actions = ['Examine the door', 'Try to force it'] def third_scenario_code(): print "Let me try to crack this thing up, says Lars as he starts to type in the panel. You hear the sounds of the fight out there, there's not much time left. " print "After receiving several commands a window with a code pop ups. " print codefile.read() def third_scenario(): print "You two get out of the cell and approach to the exit, a long corridor is ahead of you, flashing red lights indicate an state of emergency, you must evacuate." print "As soon as you two approach to the door, it closes" print "Crap it must be the emergency system, we have been detected" next = raw_input("What do you do> ") if next == 'Examine the door': print "A small panel comes out, requires to enter a code of words" third_scenario_code() elif next == 'Try to force it': print "You try to force the door with no result" print options_thirdscenario_actions next2 = raw_input("What else do you do> ") if next2 = 'Examine the door' third_scenario_code() else: print "You already did that"
내가 전체 프로그램에 유사한 오류가 발생하고 있는데 나는 그것이 들여 쓰기 함께 할 수있는 뭔가가 생각,하지만 난 모든 시도했다 제안 나는 결실 결과없이 구글에서 볼 수 있습니다. 미리 감사드립니다.
'third_scenario_code()'는 들여 쓰지 않아야합니다. –
'third_scenario_code'-lines는 들여 쓰기가 잘못되었습니다. 사용자 탭과 항상 들여 쓰기를위한 4 칸을 절대로 사용하지 마십시오. 편집기를 구성하여 도움을 받으십시오. – Daniel