私はPythonとプログラミングの初心者です。私はカレッジ来るために頭を尽くすことを試みている夏期。私はこの初心者の本から学びたいと思っており、次のコードを私が書いているとおり正確に引用しています。スペースのインデントをどのように変更しようとしましたが、まだこのメッセージが表示されます。私はおそらくここに何かが不足していることを理解していますが、私はどのように進めるべきかについてのアドバイスを感謝します。IndentationErrorで新しく突っ込んだ:インデントされたブロックが予想されました
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)]
>>> # Ghost Game
... from random import randint
>>> print('Ghost Game')
Ghost Game
>>> feeling_brave = True
>>> score = 0
>>> while feeling_brave:
... ghost_door = randint(1, 3)
File "<stdin>", line 2
ghost_door = randint(1, 3)
^
IndentationError: expected an indented block
>>> ghost_door= randint(1, 3)
>>> while feeling_brave:
... ghost_door= randint(1, 3)
File "<stdin>", line 2
ghost_door= randint(1, 3)
^
IndentationError: expected an indented block
>>> while feeling_brave:
... ghost_door = randint(1, 3)
File "<stdin>", line 2
ghost_door = randint(1, 3)
^
IndentationError: expected an indented block
>>> while feeling_brave:
... ghost_door = randint(1,3)
File "<stdin>", line 2
ghost_door = randint(1,3)
^
IndentationError: expected an indented block
>>> while feeling_brave:
... ghost_door =randint(1,3)
File "<stdin>", line 2
ghost_door =randint(1,3)
あなたのインデントを修正してください(わからない場合は、googleが知っているでしょう) –
あなたがする必要があるのはインデント 'ghost_door'です。ちょうどエラーのように言う – kstullich
私はそれを理解するので、私は 'g'の前にインデント?申し訳ありませんが、私はまだレイアウトを理解しようとしています。 – Joseph