Читать книгу Introduction to Python Programming for Business and Social Science Applications - Frederick Kaefer - Страница 51

Syntax Errors

Оглавление

Syntax errors occur when the Python code does not follow the rules that dictate how to write Python code statements. The interpreter identifies syntax errors and highlights the cause of the syntax error in red font in the Python shell window, as shown in Figure 2.7. When a syntax error exists in Python code, the code will not execute until you resolve the syntax error. The cause of the syntax error in this example is that there is nothing combining the string and the variable symbol within the print statement (such as a comma “,”).

Description

Figure 2.7 Python Syntax Error

Introduction to Python Programming for Business and Social Science Applications

Подняться наверх