ID EN
Built-in Exceptions

SyntaxError

Python 3.11

Raised when the parser encounters a syntax error. This may occur in an import statement, in a call to the built-in functions compile(), exec(), or eval(), or when reading the initial script or standard input (also interactively).

Syntax

PYTHON
exception SyntaxError(message, details)

See Also

import compile() exec() eval() str() end_lineno end_offset