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)?
Let’s experiment:
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.