Skip to content

Commit 61bd6e5

Browse files
authored
Update expected error message for incomplete if syntax
this is the latest error message as of Python 3.10 (also 3.11, 3.12, 3.13)
1 parent 042d5a2 commit 61bd6e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

en/python_introduction/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,9 @@ If we were to save and run this, we'd see an error like this:
658658
{% filename %}{{ warning_icon }} command-line{% endfilename %}
659659
```
660660
$ python3 python_intro.py
661-
File "python_intro.py", line 2
662-
^
663-
SyntaxError: unexpected EOF while parsing
661+
File "python_intro.py", line 1
662+
if 3 > 2:
663+
IndentationError: expected an indented block after 'if' statement on line 1```
664664
```
665665

666666
Python expects us to give further instructions to it which are executed if the condition `3 > 2` turns out to be true (or `True` for that matter). Let’s try to make Python print “It works!”. Change your code in your **python_intro.py** file to this:

0 commit comments

Comments
 (0)