IndentationError: unindent does not match any outer indentation level

后端 未结 30 2036
Happy的楠姐
Happy的楠姐 2020-11-21 07:48

When I compile the Python code below, I get

IndentationError: unindent does not match any outer indentation level




        
30条回答
  •  攒了一身酷
    2020-11-21 08:44

    IMPORTANT: Spaces are the preferred method - see PEP008 Indentation and Tabs or Spaces?. (Thanks to @Siha for this.)

    For Sublime Text users:

    Set Sublime Text to use tabs for indentation: View --> Indentation --> Convert Indentation to Tabs

    Uncheck the Indent Using Spaces option as well in the same sub-menu above. This will immediately resolve this issue.

提交回复
热议问题