This is an introductory guide to Python, aimed at students who have no programming experience and want to learn Python from scratch. Whether your starting point for learning is interest-driven, expanding your thinking, or work needs, or you want to change careers, you can use this article as a reference.
#In this era of information explosion, there are thousands of search results using the keyword "Getting Started with Python". Many novice players will inevitably hit here and there with a hammer and a stick, and end up reading a lot of articles, but still haven't crossed the threshold of being a novice.
Combining our own learning experience and communication and understanding with many self-learners, we have compiled a highly operable self-study route, and also collected various forms of high-quality Python learning resources for you who have not yet started or A reference for students who are just getting started.
MENTAL PREPARATION
Programming is a technology, it can also be said to be a craft. Just like calligraphy, painting, musical instruments, sculpture, etc., behind the proficiency of skills must be a long period of repeated practice. The world of programming is vast, so please keep an awe-inspiring attitude to learn, and take every line of code and even every character you write seriously. Pack up your mentality and set off towards the world of programming.
Entry stage
The first step is crucial, whether it is related to whether beginners go from getting started to becoming proficient or from getting started to giving up. Choose a suitable entry path and stick to it.
1.1 Configure Python learning environment
Python2 or Python3?
Many people are wondering whether they should learn Python2 or Python3 when getting started. This is not really a problem. I've never heard of anyone being a Python2 programmer or a Python3 programmer. The two are just program incompatible, there is no big difference in thinking, and there are not many grammatical changes. Whichever one you choose to start with will have no big impact.
If you still can't decide, please choose Python3.
How to choose an editor?
I recommend the pycharm community version, which is simple to configure, powerful, saves time and worry to use, and is friendly to beginners. And it’s completely free!
Other editors you can try:
idle: Python comes with its own editor. If you just want to write a few lines of code as quickly as possible, this is the easiest way.
vs code: Visual Studio Code - Code Editing. Redefined
atom: A hackable text editor for the 21st Century
SublimeText: Sublime Text - Download
notepad: Notepad Home
In order to allow beginners to focus more on writing code, we do not recommend vim and Emacs.
operating system?
Python supports all existing mainstream operating platforms, whether it is windows, mac or linux, they can all run Python well. And the latter two both come with a Python environment by default.
1.2 Introductory Tutorial
"Crossin's Programming Classroom-Introduction to Python"
Crossin's Programming Classroom-Introduction to Python
I think it is the most basic An easy-to-understand introductory tutorial, very suitable for people without any programming foundation to get started.
74 graphic tutorials, from the simplest Python installation to basic syntax, data structures, functions, file operations, network requests, object-oriented, etc., and gradually go into depth.
The best way to deepen your impression of a knowledge point is to write the code yourself to implement it. If you still don’t understand, try it again. So no matter which tutorial you use, please enter all the sample codes on your computer and run it, learning by doing!
Supporting exercises
Crossin's programming classroom-basic exercises
Crossin's programming classroom-online exercises
Extracurricular exercises
《Stupid Learn Python the Hard Way"
Preface - [Learn Python the Hard Way] - Read
This is a very famous Python book, but it is not suitable for self-study with zero basic knowledge. Because it emphasizes practice but does not explain it, novices can easily get confused. It is more suitable as an aid while studying.
Other recommended tutorials
"The Programming Journey of Father and Son" also known as "Learning Programming with Children"
This is also a very suitable introduction to Python with zero foundation. books. Students who like to read paper books can buy one, which is available in many online bookstores.
"Concise Python Tutorial"
Read online: Concise Python Tutorial
This is a concise and comprehensive Python introductory tutorial, simple and straightforward, no nonsense. It is suitable for people who have experience in other languages to quickly understand Python syntax.
The above are the learning materials we recommend, mainly focusing on pure novices who do not have much programming foundation. There are also some good resources for learners with different needs:
Online text tutorial:
Liao Xuefeng’s Python tutorial
Python tutorial
Mr. Liao's tutorials cover all aspects of Python knowledge. The content is more systematic and in-depth. After you have a certain foundation, you will gain more from learning.
Head First Python
Dive Into Python
Python core programming
In-depth understanding of Python
Python standard library
Python Programming Guide
codecademy and codeschool, two websites for learning Python through the Internet, are both highly praised. Might as well go and experience it.
2. Promotion stage
After completing the basic learning at the introductory stage, you will often fall into a bottleneck period. It is difficult to further improve your programming level by watching tutorials. At this time, what is needed is practice, a lot of practice.
You can start from the routines in the book, then write small program fragments, and then write the complete project.
We have collected some practice questions and websites. You can choose appropriate exercises to do according to your own stage. It is suggested that it is best to pick one or two series to focus on, rather than just dabbling in them here and there.
Crossin's Programming Classroom - Weekly Pitfall:
The official account of the Programming Classroom will release a question for practice every week and explain it in the next week. Welcome to follow the WeChat public account and submit answers together with everyone.
3. What should I do if I encounter a problem?
Various problems will arise more or less during the learning process. Don’t try to escape. Real warriors dare to face the disastrous bugs head-on.
The first step is definitely to make good use of search engines. How to use them is also a technical job:
How to use search engines for beginners in programming
The second step is to ask for help from various sources. Gay dating website (dense fog):
4. Advice from people who have experienced it
When you first learn programming, you will have all kinds of doubts. You will encounter various pitfalls. At this time, the experience of predecessors is particularly important. We have compiled some Zhihu questions for reference:
5. Write at the end
After the first and second steps Step by step training, I believe that ordinary small programs will not be difficult for you. You have already taken a key step in the world of programming. Next, you can challenge specific projects. The rich world of crawlers, web development, data analysis, machine learning, etc. is already open to you. Choose a direction and start again!
Remember: There are no shortcuts on the road to programming.
The above is the detailed content of How to learn python programming. For more information, please follow other related articles on the PHP Chinese website!

There are many methods to connect two lists in Python: 1. Use operators, which are simple but inefficient in large lists; 2. Use extend method, which is efficient but will modify the original list; 3. Use the = operator, which is both efficient and readable; 4. Use itertools.chain function, which is memory efficient but requires additional import; 5. Use list parsing, which is elegant but may be too complex. The selection method should be based on the code context and requirements.

There are many ways to merge Python lists: 1. Use operators, which are simple but not memory efficient for large lists; 2. Use extend method, which is efficient but will modify the original list; 3. Use itertools.chain, which is suitable for large data sets; 4. Use * operator, merge small to medium-sized lists in one line of code; 5. Use numpy.concatenate, which is suitable for large data sets and scenarios with high performance requirements; 6. Use append method, which is suitable for small lists but is inefficient. When selecting a method, you need to consider the list size and application scenarios.

Compiledlanguagesofferspeedandsecurity,whileinterpretedlanguagesprovideeaseofuseandportability.1)CompiledlanguageslikeC arefasterandsecurebuthavelongerdevelopmentcyclesandplatformdependency.2)InterpretedlanguageslikePythonareeasiertouseandmoreportab

In Python, a for loop is used to traverse iterable objects, and a while loop is used to perform operations repeatedly when the condition is satisfied. 1) For loop example: traverse the list and print the elements. 2) While loop example: guess the number game until you guess it right. Mastering cycle principles and optimization techniques can improve code efficiency and reliability.

To concatenate a list into a string, using the join() method in Python is the best choice. 1) Use the join() method to concatenate the list elements into a string, such as ''.join(my_list). 2) For a list containing numbers, convert map(str, numbers) into a string before concatenating. 3) You can use generator expressions for complex formatting, such as ','.join(f'({fruit})'forfruitinfruits). 4) When processing mixed data types, use map(str, mixed_list) to ensure that all elements can be converted into strings. 5) For large lists, use ''.join(large_li

Pythonusesahybridapproach,combiningcompilationtobytecodeandinterpretation.1)Codeiscompiledtoplatform-independentbytecode.2)BytecodeisinterpretedbythePythonVirtualMachine,enhancingefficiencyandportability.

ThekeydifferencesbetweenPython's"for"and"while"loopsare:1)"For"loopsareidealforiteratingoversequencesorknowniterations,while2)"while"loopsarebetterforcontinuinguntilaconditionismetwithoutpredefinediterations.Un

In Python, you can connect lists and manage duplicate elements through a variety of methods: 1) Use operators or extend() to retain all duplicate elements; 2) Convert to sets and then return to lists to remove all duplicate elements, but the original order will be lost; 3) Use loops or list comprehensions to combine sets to remove duplicate elements and maintain the original order.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version
Chinese version, very easy to use

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
