Python is in sharp contrast to other languages in its Easy-to-understand syntax format, and the most common problem for beginners is not to write in Python's rules, and even programmers with programming experience are apt to write Python code in an inherently mental and grammatical format, making it easy to make mistakes. Here's a list of the easy mistakes you can make to get started with Python.
1. Forget to write a colon
Forget to add ":" After the If, elif, else, for, while, class, Def statement
2. Misuse of "=" to do equivalence comparison
"=" is an assignment operation, and determining whether two values are equal is "= ="
3. Using the wrong indentation
Each line of code in the same code block must maintain a consistent indent
4. Variables are not defined
5. Get list element index location forget to call Len Method
6. Modify the string
A string is an immutable object and does not support modification.
7. String and non-string connection
When a string is concatenated with a non-string, the non-string object must be cast to a string type.
8. Use the wrong index location
The index of the list object starts at 0, and the correct index number is to be mastered.
9. Use a nonexistent key in the dictionary
10. Use the keyword to make variable name
Using keywords as variable names is not allowed in Python.
11. The function is used before the local variable is assigned a value
12. Use the self-added "+ +" self-reduction "--"
There is no self-subtraction operator in Python, which can be replaced with "+ =" and "=".
13. Calling methods in a class incorrectly
The above is to Python3 often make a summary of mistakes, some also apply to Python2, some of the Python2 does not apply, want not to make mistakes, or as little as possible, you need to firmly grasp the basic Python grammar and specific usage.