Python is an object-oriented scripting language that was released publicly in 1991. It was developed by Guido van Rossum of the National Research Institute for Mathematics and Computer Science in Amsterdam.
Python has rapidly become one of the world’s most popular programming languages. It’s now particularly popular for educational and scientific computing,8 and it recently surpassed the programming language R as the most popular data-science programming language.9,10,11 Here are some reasons why Python is popular and everyone should consider learning it:12,13,14
It’s open source, free and widely available with a massive open-source community.
It’s easier to learn than languages like C, C++, C# and Java, enabling novices and professional developers to get up to speed quickly.
It’s easier to read than many other popular programming languages.
It’s widely used in education.15
It enhances developer productivity with extensive standard libraries and thousands of third-party open-source libraries, so programmers can write code faster and perform complex tasks with minimal code. We’ll say more about this in Section 1.8.
There are massive numbers of free open-source Python applications.
It’s popular in web development (e.g., Django, Flask).
It supports popular programming paradigms—procedural, functional, object-oriented and reflective.16 We’ll begin introducing functional-style programming features in Chapter 4 and use them in subsequent chapters.
It simplifies concurrent programming—with asyncio and async/await, you’re able to write single-threaded concurrent code17, greatly simplifying the inherently complex processes of writing, debugging and maintaining that code.18
There are lots of capabilities for enhancing Python performance.
It’s used to build anything from simple scripts to complex apps with massive numbers of users, such as Dropbox, YouTube, Reddit, Instagram and Quora.19
It’s popular in artificial intelligence, which is enjoying explosive growth, in part because of its special relationship with data science.
It’s widely used in the financial community.20
There’s an extensive job market for Python programmers across many disciplines, especially in data-science-oriented positions, and Python jobs are among the highest paid of all programming jobs.21,22
We use the Anaconda Python distribution because it’s easy to install on Windows, macOS and Linux and supports the latest versions of Python (3.7 at the time of this writing), the IPython interpreter (introduced in Section 1.10.1) and Jupyter Notebooks (introduced in Section 1.10.3). Anaconda also includes other software packages and libraries commonly used in Python programming and data science, allowing students to focus on learning Python, computer science and data science, rather than software installation issues. The IPython interpreter23 has features that help students and professionals explore, discover and experiment with Python, the Python Standard Library and the extensive set of third-party libraries.
We adhere to Tim Peters’ The Zen of Python, which summarizes Python creator Guido van Rossum’s design principles for the language. This list can be viewed in IPython with the command import
this
. The Zen of Python is defined in Python Enhancement Proposal (PEP) 20. “A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment.”24
(Fill-In) The summarizes Python creator Guido van Rossum’s design principles for the Python language.
Answer: Zen of Python.
(True/False) The Python language supports popular programming paradigms—procedural, functional, object-oriented and reflective.
Answer: True.
(True/False) R is most the popular data-science programming language.
Answer: False. Python recently surpassed R as the most popular data-science programming language.