初心者のメモ

Python enthusiast

Python 'indentationError: expected an indented block'

他人が書いたPythonコードを触っていたら、 indentationError: expected an indented block とやたら怒られる。 見た目は同じだが、タブと空白が入り混じってインデントが乱れていた。。

"タブ文字の占める幅が4文字"設定のエディタで書かれたコードを "タブ文字の占める幅が2文字"の状態で触っていた。 タブ2回押して見た目を合わせながら書いているとこうなる。 初心者ならではのミスでした。