The language was born in the 1990s. It is already a 25-year-old uncle-level language by now (there is also a famous java in the same era, which was released in 1995 and became popular a few times. Ten years). But Python’s real fame came many years later than Java. In fact, it was mainly due to the changes in the application field. (guess why, yes, the emergence of big data)
Python2
is a very important version of Python. The earliest version started in 2001, especially the release of py2.5 starting in 2006. The functions of python It gradually became stronger and stabilized, and one version was added every 1-2 years. It slowly became popular around 2008. Python3 was first released in 2008, but the version of py3.0 was very different. It is stable, so the community updates quickly, every few months. So not many people used it at the beginning. It was only when python3.4 was delivered in the spring of 2014 that it began to slowly stabilize. Let’s look at a piece of data below. This is a piece of data compiled by the Python community and some websites in 2014. The survey, regarding Python2/3, some results are as follows:
1).97.51% of users are still writing Python2 code
2).60% of users are writing Python3 code
3).78.09% of users write more Python2 code
4).77.09% of users recognize Python3. Currently, some operating systems in Linux already use Python3 by default:
1).Arch Linux (lightweight Linux operating system)
2).Ubuntu 16.04 (a desktop application-based Linux operating system)
3).Fedora (Redhat desktop version Continuation)
Related recommendations: "python video tutorial"
2. The main difference between Python2 and Python3:
The latest data is that Python has two versions: one is version 2.7.12 and the other is version 3.5.12. So Python2 runs well, why is Python3 suddenly released? In fact, it is to solve some of the history in Python2 The first problem is about strings:
1. Chinese text and binary data are a mess. It is ambiguous whether str in Python represents binary data or text data. Text can represent both text data. It is troublesome to represent binary data, and it is difficult for us to realize when such errors occur. The second is support for Unicode. Since Python was released as open source in February 1991, this means that it preceded the first version of the Unicode standard, which was released in October 1991. In the next few years, languages that emerged later than the Unicode standard chose to implement their own str type on the basis of supporting Unicode encoding, which put Python 2 in an awkward position. Currently, we are in an era where python2/3 coexist, and these two versions are incompatible.
2. python2 is currently only doing bug fixes and maintenance related to new hardware and operating system compatibility. No new features will be added, and python2 will only be supported until 2020. Now Python is evolving towards version 3. During the evolution process, a large amount of code for the 2.x version needs to be modified before it can run, so there are currently many Third-party libraries are temporarily unavailable on 3.x. But you can think about it, maybe the situation will be much better in a few years. After all, there are many excellent programmers around the world migrating some libraries from Py2 to Py3.
3. The choice still depends on your own If the requirement is enterprise development, it must meet the work needs, especially if the dependent software can only run under Python2, Python2 is the first choice. For example, your development needs to rely on a large number of third-party libraries (because one of the reasons why learning Python is very important is It has thousands of third-party packages), such as a large number of data analysis and scientific calculations, so choose Python2. If you study and research by yourself and are willing to embrace changes, then it is recommended to learn Python3, because it is the direction of the future. .Conclusion: Programming is actually mainly about the understanding of programming ideas and the accumulation of experience. Don’t waste a lot of time just because you are confused about whether to learn Py2 or Py3.
4. The ideas in Py2 and Py3 are basically the same, and the moves are similar. When you are familiar with Python to a certain program, it only takes a short time for someone who knows Py2 to learn Py3. So don’t waste precious learning time by worrying about minute grammatical differences. Okay, that’s it for the grievances between Python2 and Python3 (they will still love and kill each other for a while). I hope it can give some inspiration to beginners. If you don’t understand anything, you can also leave a message with me to discuss and communicate.
The above is the detailed content of Which one is more commonly used, python2 or 3?. For more information, please follow other related articles on the PHP Chinese website!

Python is easier to learn and use, while C is more powerful but complex. 1. Python syntax is concise and suitable for beginners. Dynamic typing and automatic memory management make it easy to use, but may cause runtime errors. 2.C provides low-level control and advanced features, suitable for high-performance applications, but has a high learning threshold and requires manual memory and type safety management.

Python and C have significant differences in memory management and control. 1. Python uses automatic memory management, based on reference counting and garbage collection, simplifying the work of programmers. 2.C requires manual management of memory, providing more control but increasing complexity and error risk. Which language to choose should be based on project requirements and team technology stack.

Python's applications in scientific computing include data analysis, machine learning, numerical simulation and visualization. 1.Numpy provides efficient multi-dimensional arrays and mathematical functions. 2. SciPy extends Numpy functionality and provides optimization and linear algebra tools. 3. Pandas is used for data processing and analysis. 4.Matplotlib is used to generate various graphs and visual results.

Whether to choose Python or C depends on project requirements: 1) Python is suitable for rapid development, data science, and scripting because of its concise syntax and rich libraries; 2) C is suitable for scenarios that require high performance and underlying control, such as system programming and game development, because of its compilation and manual memory management.

Python is widely used in data science and machine learning, mainly relying on its simplicity and a powerful library ecosystem. 1) Pandas is used for data processing and analysis, 2) Numpy provides efficient numerical calculations, and 3) Scikit-learn is used for machine learning model construction and optimization, these libraries make Python an ideal tool for data science and machine learning.

Is it enough to learn Python for two hours a day? It depends on your goals and learning methods. 1) Develop a clear learning plan, 2) Select appropriate learning resources and methods, 3) Practice and review and consolidate hands-on practice and review and consolidate, and you can gradually master the basic knowledge and advanced functions of Python during this period.

Key applications of Python in web development include the use of Django and Flask frameworks, API development, data analysis and visualization, machine learning and AI, and performance optimization. 1. Django and Flask framework: Django is suitable for rapid development of complex applications, and Flask is suitable for small or highly customized projects. 2. API development: Use Flask or DjangoRESTFramework to build RESTfulAPI. 3. Data analysis and visualization: Use Python to process data and display it through the web interface. 4. Machine Learning and AI: Python is used to build intelligent web applications. 5. Performance optimization: optimized through asynchronous programming, caching and code

Python is better than C in development efficiency, but C is higher in execution performance. 1. Python's concise syntax and rich libraries improve development efficiency. 2.C's compilation-type characteristics and hardware control improve execution performance. When making a choice, you need to weigh the development speed and execution efficiency based on project needs.


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

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.

SublimeText3 Chinese version
Chinese version, very easy to use