How to systematically learn a Python language

Source: Internet
Author: User
It is a good choice to learn a language to enrich yourself. Python is concise, elegant, and easy to use. So how to systematically learn Python? It is a good choice to learn a language to enrich yourself. Python is concise, elegant, and easy to use. So how to systematically learn Python?

Some people really want to learn Python well. On the one hand, they have been entangled in trivial matters and have never been able to do it. on the other hand, they are worried that the learning cost is too high and they are quietly trying to leave their hearts blank?

Fortunately, Python is a beginner-friendly programming language and you don't have to spend too much time and effort to fully master it.

One of the design philosophy of Python is that it is easy to learn and embodied in two aspects:

The syntax is concise and clear: compared with Ruby and Perl, there are not many syntax features. most of them are simple and straightforward.

There are many entry points: Python allows you to do many things, such as scientific computing and data analysis, crawlers, Web websites, games, and command line utilities, you are always interested and willing to invest time.

There is only one shortcut to learning a language: Getting Started

1. Initial stage

Any programming language contains two parts: hard knowledge and soft knowledge. The main task in the initial stage is to master hard knowledge. Any programming language contains two parts: hard knowledge and soft knowledge. The main task in the initial stage is to master hard knowledge.

1. hard knowledge

"Hard knowledge" refers to the syntax, algorithms, data structures, and programming paradigm of programming languages, such as variables and types, cyclic statements, branches, functions, and classes. This part of knowledge is also universal. it seems that it has mastered a syntax, but it is actually a kind of thinking. For example, if a Java programmer learns Python, he can quickly map the learned object-oriented knowledge in Java to Python, so that he can quickly master the object-oriented features in Python.
If you are a beginner in programming, a reliable grammar book is very important. It may seem boring, but it is essential to build a solid programming mindset.
The following lists some teaching materials suitable for beginners:

Explain "stupid methodology Python": http://learnpythonthehardway.org/book/
This book also comes with a large number of practical examples to explain the syntax of Python, which is very suitable for quick start.

「 The Hitchhiker's Guide to Python !」 : The Hitchhiker's Guide to Python!
This guide focuses on the best practices of Python, and can be of great help whether you are a Python expert or novice.

Remark "Python official Documentation": Our Documentation
In practice, you can find answers to most of the questions in the official documentation.

Helper tool: Python Tutor
A Python object visualization project helps you understand various concepts in Python with graphics.

Python philosophy:

There is only one way to do one thing.

The same is true for learning. although a variety of learning materials are recommended, it is best to choose only one of them during actual learning and finish reading.

When necessary, you may need to read books that explain Data Structures and Algorithms. this knowledge is of great help in understanding and using object models in Python.


2. soft knowledge
"Soft knowledge" is the syntax skills in a specific language environment, the use of class libraries, the selection of IDE, and so on. This part, even if you do not understand it, will not prevent you from programming, but write the program, it looks silly.

The learning of this knowledge depends on the domain and depth of the problem you are trying to solve. For beginners, it is very easy to get angry in the initial stage, or they cannot decide when selecting the Python version. after a while, they can see 2.7 and then go to 3.0, or they can't extricate themselves in the sea of class libraries. Scrapy, numpy, Django should try everything, or participate in meaningless activities such as the editor mujie', braces indent inquiry, and the operating system debate competition, or lick the syntactic sugar all day, I am always thinking about how to finish everything with a line of code, or to think about a solution with full scores of holy performance, security, versatility, robustness.

Many "Daniel" will warn beginners to use this tool to avoid detours, which in turn pushes beginners towards a real detour.
It is better to tell beginners that learning is a process that requires you to take a detour and make a Bug. you can only be down-to-earth. there is no miracle but a shit.

Choose a direction to go first, even if it is dirty or ugly, and then see if there is a better solution.

Only by taking a detour can you understand the benefits of doing so and understand why people can write state machines to match but prefer to create regular expressions. why is process-oriented solution but object-oriented, why do I need to automatically manage the memory while manipulating each pointer? why do I need to use Promise for nested callbacks...

More importantly, you will understand that high-level solutions are encapsulation of low-level solutions, which is not the most effective and suitable in any situation.

Technology surges like waves. old technologies that have been retained for a long time will soon return. Just like the popularity of mobile apps, mobile games, and HTML5, are some aspects not repeating the history of PCs in the past?

Therefore, do not worry that you have taken the wrong path for a lifetime. it is the right way to stick to and keep improving.

In the initial stage, the core task is to master hard knowledge and learn soft knowledge properly. with a solid root and thick branches, thick leaves can grow to produce sweet fruits.

2. development stage

After learning the basic knowledge, you will surely feel a bit empty and doubt whether these grammar knowledge is really useful.
Yes, your doubts are very correct. To make Python play its value, you certainly cannot stay at the syntax level.
The core task in the development phase is to "jump out of Python and embrace the world ".
There are multiple branches in front of you: scientific computing and data analysis, crawlers, Web websites, games, command line utilities, etc, these are not problems that can be solved simply by knowing the Python syntax.
Take crawlers for example. if you have no idea about computer networks, HTTP protocols, HTML, text encoding, and JSON, can you do this? Your basic knowledge in the initial stage is equally important. if you even need to query the document for how to write recursive loops, you do not even know how to implement BFS, this is just like a craftsman who thinks about how to use a hammer every time he makes a stone bench. it is very inefficient.
At this stage, it is inevitable to access a large number of class libraries and read a large number of books.

° 1 class library
「 Awesome Python Project': vinta/awesome-python · GitHub
The existing tool class libraries in the Python community are listed here when you try to solve various practical problems, as shown in:

Everyone learns programming differently. In fact, most of them share the same path, and no lost person can only stick to it. Although it sounds a little chicken soup, it is a fact.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.