Pythonexit code > 0

IndentationError: unexpected indent

$IndentationError: unexpected indent

Analysis

Python found an indentation level that doesn't match the expectation.

Common Triggers

  • Mixing tabs and spaces.
  • Extra spaces at the beginning of a line.

Debug Checks

  • $Configure your editor to show whitespace characters.
  • $Ensure you are using consistent indentation (usually 4 spaces).

Resolution

1
Fix the indentation to align with the surrounding block.
2
Convert all tabs to spaces.