Python
From a first program to the interpreter's internals, Django to pandas to PyTorch, the language as told through the free samples of the Leanpub books about Python.
Created from the free samples of 39 Leanpub books and the descriptions and tables of contents of 20 more, with every source cited.
Python is a high-level, general-purpose programming language, created by Guido van Rossum in the Netherlands in the late 1980s and first released in 1991. Its design puts readability first: blocks are marked by indentation, types are checked at run time, memory is garbage-collected, and the standard library is large enough that the language is described as "batteries included".[1] The qualities that made it a teaching language made it the working language of system administrators and web developers and, above all, of data analysis and machine learning, and it has ranked among the most used programming languages for well over a decade.
Python today means Python 3. The 2008 release broke compatibility with Python 2, the two coexisted for more than a decade, and Python 2 reached the end of its life in 2020; the books read for this article span that transition. The language now moves by annual releases, 3.13 being current when the newest of them were written, and the tooling around it has moved faster: pip, virtual environments, conda and lately uv for packages; Jupyter notebooks for exploratory work; pytest for tests; Django, Flask and FastAPI for the web; NumPy, pandas, scikit-learn and PyTorch for numbers. Most current work on language-model applications and AI agents is written in it too.
This article covers the language and its object model, the standard library and the tools around it, web and desktop applications, data analysis and scientific computing, machine learning and AI, and Python at work in operations, hardware and production pipelines. Its sources are the free samples of the Leanpub books listed at the end: where a sample states something, the sentence cites it; the rest is general knowledge of the language.
Where to start
The sources are unusually clear about who they are for. A reader who has programmed in another language can start with The Python Apprentice, which treats the object model and reference semantics early and leads into two further volumes,[2] or with 100 Page Python Intro, a deliberately short guide tested against Python 3.13 for readers who know the basics of programming and are willing to read a manual.[1] Python 101 starts from installation and goes past the basics into small applications and packaging, though its text is pinned to Python 3.8.[3] Build applications in Python the anti textbook is a short free introduction that ends in a working command-line program.[8] A reader who has never programmed at all is better served by Introduction to GIS Programming, which begins at Python novice before any geospatial work,[29] or, for the mathematically inclined, by Discrete Mathematics for Computer Science, whose Python projects run in the browser.[12]
Learners who have the syntax and stall at a particular step have a book for the step: Learn Python With No Programming Experience: Why, How, and When to Use Functions spends a chapter on why functions exist before any syntax,[19] Object Oriented Programming with Python does the same for classes,[21] and TLDR: Data Structures and Algorithms covers data structures with basic Python as its only prerequisite.[45] From there The Python Journeyman, Python 201 and Practice Python Projects are the intermediate reading,[22][25][11] and Inside The Python Virtual Machine and The Python Master the advanced.[24][23]
For the data work that brings most people to the language, A Hands-On Introduction to Essential Python Libraries and Frameworks (With Code Samples) is an orientation, a few pages on each of about forty libraries,[4] and Effective Pandas, by a pandas core developer, is the next step once some pandas is in hand, though its text dates from 2016.[43]
History
Van Rossum began Python as a hobby project at the Centrum Wiskunde & Informatica in Amsterdam, as a successor to the ABC language, and named it after Monty Python's Flying Circus. One survey of the ecosystem retells the start: a language meant to be easy to read and write, whose first version, 0.9.0 in 1991, already had modules, exceptions, and lists, dictionaries and tuples as its core types.[4] Python 2.0 followed in 2000. The non-profit Python Software Foundation holds the language's intellectual property, and for most of its life van Rossum guided it as "Benevolent Dictator for Life";[2] he stepped back in 2018 and a steering council has governed since.
Python 3.0 (2008) made print a function, changed string formatting and division, and removed features judged outdated; later releases added async/await and type annotations while keeping compatibility.[4] Code for one version will generally not run on the other, and one introduction written while both were common told its readers that Python 3 was the future and to use it if at all possible.[2] The library records the long overlap: an unofficial ebook of the official Python 2.7 tutorial from 2014,[5] a Django textbook for Python 2.7 or 3.5,[6] a PDF toolkit guide for Python 2.7 and 3.3+ that explains virtualenv before the venv module that replaced it,[7] a 2019 primer that still opens on Python 2 against 3,[8] and a GUI toolkit whose Python 3 port needed a code name, Phoenix.[9]
The newest samples show where the language stands. A hundred-page introduction is tested against Python 3.13.0,[1] a regular-expressions guide against 3.13.1,[10] a project book against 3.13.3;[11] the second edition of Python 101 was rewritten for 3.8, its author updating every chapter rather than patching the first.[3]