Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to learn Python

Shulou Source: shulou.com Published: 2022-06-01 11:21:07 10月03日 Update

Editor to share with you how to learn Python, I hope you will learn something after reading this article. Let's discuss it together.

First of all, learn from the basics and don't be impatient.

At the beginning of learning Python, we may be a little impetuous and always think that this knowledge is too simple to learn, in fact, this idea is completely wrong, because the foundation of Python is very important, it is like building a house, if you do not lay a good foundation, no one can guarantee the firmness of the house in the later stage, so the foundation of Python learning is very important. We can prepare a small notebook when we learn the basics in the early stage. Take notes while studying and summarize the basics in a unified way, so that it will be much more convenient to review or find knowledge that you do not know in the later stage.

Secondly, read more books, read good books, and be able to read

At present, although there are not as many books about Python as C++ and Java, it is enough to assist us in our study. When we learn Python, we can choose several books to assist us in our study. When it comes to reading, we have to be able to read and read good books. How can we read? First of all, Python books are technical, we can't just read "the Sage Book" all day long, we have to practice the code according to the above actual combat part, accumulate our own project practical experience, at the same time, it is also very necessary to write the code.

Finally, you must make the necessary preparations before you study.

Learning any language to choose the operating system, building a development environment is essential. When we learn Python, the editor recommends to choose the Linux system. In the Linux platform, we generally configure the Python development platform, and once the system is installed, we can write programs. Of course, if you have to choose windows, you should download and configure the Python development environment yourself.

How to learn Python we will share here today, but as a novice in Python, we will generally encounter the following problems in our study:

1. Do not understand Python object model, variable name, object concept ambiguity.

two。 Do not understand mutable objects and immutable objects, especially int.

3. Not knowing about slicing means copying, which is widely used in loops and affects efficiency.

4. Do not know whether the slice is a shallow copy or a deep copy.

5. I get dizzy when I encounter bytes and str (str and unicode in 2.7).

6. Often use = = in scenarios where you need to use is.

7. Do not understand that def is a run-time execution statement and an assignment statement.

8. Class properties are confused with instance properties.

9. Do not understand that modifying variable object parameters in a function will affect the caller, resulting in an inexplicable error.

10. An attempt was made to modify the global variable in the function, instead of using global, a local variable was created.

11. The variable object is used as the default parameter of the function.

After reading this article, I believe you have a certain understanding of "how to learn Python". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Learning objects fundamentals knowledge variability selection necessity functions variables copy system Development impatience importance Code parameters good Books practice attributes platform Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Linux Microsoft Apple MySQL