00:23 If the interpreter finds invalid syntax at this parsing stage, it will attempt to show you where the error occurred. When you’re first learning Python, it can be frustrating to get syntax errors.
00:34 Python will attempt to help you determine where the invalid syntax is in your code, but the traceback it provides can be a little confusing. Sometimes the code it points to can be perfectly fine, as we’ll see in the next section.
Because syntax errors occur during the parsing stage of this process, you can’t handle invalid syntax in Python like you can other exceptions. Even if you try to wrap a
except block around code with invalid syntax, you’ll still see the interpreter raise a
Become a Member to join the conversation.