When compiling (well, “explain”) a Python program, it prompts a very special error:
IndentationError: unexpected indent
As shown in figure:
P: Print unexpected IndentationError p: Print unexpected indindent error p: Print unexpected indindent error
Indentation is actually indentation, which means indentation. Unexpected Indent means “p” is an “unexpected” indent. In other words, the problem here is that “p” is an unexpected indent. If you look at the source code, there are two lines of code. The first line is actually indented by a character bit. What happens when we indenting the sentence (the word “top” suddenly reminds me of my primary school Chinese class)?
Now, the two lines of code are implemented in the “top” write, after the explanation is no problem.
To further prove that “every sentence must be written in the top space”, we keep the first sentence in the top space and indent the second sentence by one character. Explain.
It turns out that the second line is an IndentationError, an IndentationError.
At this point, we come to the conclusion that:
In python, code should thus write each sentence.
- Python problem: indenta tionError:expected an Error resolution of indented block
- Indenta in Python tionError:unindent does Error
- In Python, print() prints to remove line breaks
- Python error prompt unindent does not match any outer indentation level
- Set code indent to space indent in eclipse
- Syntax error: unexpected character after line continuation character
- Solving syntax error: unexpected character after line continuation character
- Let’s get started with latex 05, line feed, paragraph feed, page feed, first line indent, etc
- Solution of command line window flashback when visual studio runs C + + program
- From in Python__ future__ The role of import *
- Explanation of the function strip(), lstrip(), rstrip() in Python
- How to wrap a long string in MATLAB
- Several methods of deleting all empty lines in text under Linux
- C language error: stray ‘\ 240’ in program|
- ValueError: not enough values to unpack (expected 2, got 0)
- Detailed explanation of yield in Python — the simplest and clearest explanation
- The built-in filter function in Excel can’t contain all the items
- Use Python to insert the specified content in the specified line of the specified file
- PHP reports “parse error: syntax error, unexpected T”_ The solution of “variable”
- Python: Understanding__ str__