IndentationError: unindent does not match any outer indentation level

后端 未结 30 2120
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条回答
  •  Happy的楠姐
    2020-11-21 08:38

    Looks to be an indentation problem. You don't have to match curly brackets in Python but you do have to match indentation levels.

    The best way to prevent space/tab problems is to display invisible characters within your text editor. This will give you a quick way to prevent and/or resolve indentation-related errors.

    Also, injecting copy-pasted code is a common source for this type of problem.

提交回复
热议问题