File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,17 @@ Syntax Errors
1717Syntax errors, also known as parsing errors, are perhaps the most common kind of
1818complaint you get while you are still learning Python::
1919
20- >>> while True print('Hello world')
20+ >>> a[1]] = 0
2121 File "<stdin>", line 1
22- while True print('Hello world')
23- ^^^^^
24- SyntaxError: invalid syntax
25-
26- The parser repeats the offending line and displays little arrows pointing
27- at the place where the error was detected. Note that this is not always the
28- place that needs to be fixed. In the example, the error is detected at the
29- function :func: `print `, since a colon (``':' ``) is missing just before it.
22+ a[1]] = 0
23+ ^
24+ SyntaxError: unmatched ']'
25+
26+ The parser repeats the offending line and displays a little arrow pointing
27+ at the earliest point in the line where the error was detected.
28+ Note that this is not always the place that needs to be fixed.
29+ In the example, the arrow points to the extra ``] `` bracket, which is where the
30+ error is detected.
3031
3132The file name (``<stdin> `` in our example) and line number are printed so you
3233know where to look in case the input came from a file.
You can’t perform that action at this time.
0 commit comments