2017-05-27 18 views
-5

Syntax Error: expected an indented block python構文エラー:インデントされたブロックのPythonが必要です

次のコードをコンパイルしようとすると、上記のエラーが発生します。 問題の原因を調べるには、私は助けが必要です。

def clinic(): 
    print ("You've just entered the clinic!") 
    print ("Do you take the door on the left or the right?") 
    answer = raw_input("Type left or right and hit 'Enter'.").lower() 
    if answer == "left" or answer == "l": 
    print ("This is the Verbal Abuse Room, you heap of parrot droppings!") 
    elif answer == "right" or answer == "r": 
    print ("Of course this is the Argument Room, I've told you that already!") 
    else: 
    print ("You didn't pick left or right! Try again.") 
    clinic() 

clinic() 
+3

を文はインデントされ、他の場合は、これは他のすべてのよりも何が違うのですどのように...の{}シンボル – Anders

+0

なしを使用していないコードブロック内のすべてのコードを入れてください:あなたがわからない場合は、これを読んでインデントエラーの質問? –

答えて

0

pythonでのインデントは非常に重要です。 http://www.python-course.eu/python3_blocks.php

def clinic(): 
    print ("You've just entered the clinic!") 
    print ("Do you take the door on the left or the right?") 
    answer = raw_input("Type left or right and hit 'Enter'.").lower() 
    if answer == "left" or answer == "l": 
     print ("This is the Verbal Abuse Room, you heap of parrot droppings!") 
    elif answer == "right" or answer == "r": 
     print ("Of course this is the Argument Room, I've told you that already!") 
    else: 
     print ("You didn't pick left or right! Try again.") 

clinic() 
関連する問題