Common errors and reasons in python programming

Note: The content will be continuously updated

Expected an indented block means: Expect an indented block.
Reason:
Indentation is not standardized, one less or more space (python must pay attention to indentation specifications)

SyntaxError: invalid syntax 问题

Type 1
Insert picture description here
causes of this problem and solutions:
1. Forgetting to add a colon (:) at the end of if, elif, else, for, while, class, def declaration;
2. Misuse of'= 'as' ==';

Guess you like

Origin blog.csdn.net/m0_48915964/article/details/108780296