初級 › TabError: inconsistent use of tabs and spaces の原因と直し方 › パターン4
TabError: inconsistent use of tabs and spaces の原因と直し方
同じブロックの中でタブとスペースを混在させたときに出るエラーです。
1 x = 0 2 while x < 3: 3 x += 1 4 ____print(x) ^
File "main.py", line 4
print(x)
TabError: inconsistent use of tabs and spaces in indentation
空欄を埋めて実行を通す
whileループの中でタブとスペースが混ざると発生します。1つのブロックの中では統一が必要です。
次の問題