Python is a high-level, general-purpose, structured, powerful, open source programming language that’s used for a wide variety of programming tasks. It features a fully dynamic type system and automatic memory management, similar to that of Scheme, Ruby, Perl, and Tcl, avoiding many of the complexities and overheads of compiled languages. The language was created by Guido van Rossum in 1991, and continues to grow in popularity, in part because it is easy to learn with a readable syntax. The name Python derives from the sketch comedy group Monty Python, not from the snake.
Python is a versatile language. It’s frequently used as a scripting language for web applications, embedded in software products, as well as artificial intelligence and system administration tasks. It’s both simple and powerful, perfectly suited for beginners and professional programmers alike.
This article selects an extensive range of high quality free Python books. Readers are presented with a diverse set of books with general texts designed for beginners, intermediate, and advanced programmers. More task-specific books are featured too. For example, a few of the books focus on writing Python games. Python is very popular in scientific fields, so a smattering of scientific focused titles are presented too. The majority of the books are released under an open source license. We’ve also published a compilation of the best free Python tutorials.
We’ve also published an introductory training session on the use of Python for data science.
1. Think Python 2nd Edition by Allen B. Downey
If you’re looking for an introduction to Python, look no further than Think Python.
This book begins with basic concepts of programming, and is carefully designed to define all terms when they are first used and to develop each new concept in a logical progression. Larger pieces, like recursion and object-oriented programming are divided into a sequence of smaller steps and introduced over the course of several chapters.
There’s a chapter that explores some powerful Python features.
Think Python 2e is a free book. It’s available under the Creative Commons Attribution-NonCommercial 3.0 Unported License, which means that you are free to copy, distribute, and modify it, as long as you attribute the work and don’t use it for commercial purposes.
2. Dive Into Python 3 by Mark Pilgrim
Dive Into Python 3 covers Python 3 and its differences from Python 2.
As in the original book, Dive Into Python, each chapter starts with a real, complete code sample, proceeds to pick it apart and explain the pieces, and then puts it all back together in a summary at the end.
This book includes:
- Example programs completely rewritten to illustrate powerful new concepts now available in Python 3: sets, iterators, generators, closures, comprehensions, and much more.
- A detailed case study of porting a major library from Python 2 to Python 3.
- A comprehensive appendix of all the syntactic and semantic changes in Python 3.
The book is freely licensed under the Creative Commons Attribution Share-Alike license. You can download it as HTML or PDF. And there’s a paperback available to buy.
3. The Hitchhiker’s Guide to Python! by Kenneth Reitz & Tanya Schlusser
The Hitchhiker’s Guide to Python! provides both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis.
This guide, collaboratively written by over a hundred members of the Python community, describes best practices currently used by package and application developers. Unlike other books for this audience, The Hitchhiker’s Guide is light on reusable code and heavier on design philosophy, directing the reader to excellent sources that already exist.
This book is released under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
4. Automate the Boring Stuff with Python by Al Sweigart
In Automate the Boring Stuff with Python, you’ll learn how to use Python to write programs that do in minutes what would take you hours to do by hand-no prior programming experience required.
Once you’ve mastered the basics of programming, you’ll create Python programs that effortlessly perform useful and impressive feats of automation to:
- Search for text in a file or across multiple files.
- Create, update, move, and rename files and folders.
- Search the Web and download online content.
- Update and format data in Excel spreadsheets of any size.
- Split, merge, watermark, and encrypt PDFs.
- Send reminder emails and text notifications.
- Fill out online forms.
Step-by-step instructions walk you through each program, and practice projects at the end of each chapter challenge you to improve those programs and use your newfound skills to automate similar tasks.
The book is free to read and published under a Creative Commons license.
5. Functional Programming in Python by David Mertz
Functional Programming in Python takes the reader on a tour of Python’s features suitable for implementing programs in a functional style.
After an introduction to the concepts of functional programming, the author looks at language features such as iterators and generators and relevant library modules such as itertools and functools.
Functional Programming in Python is published under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.
Next page: Page 2 – Supporting Python 3 and more books
Pages in this article:
Page 1 – Think Python and more books
Page 2 – Supporting Python 3 and more books
Page 3 – Invent Your Own Computer Games with Python and more books
Page 4 – Making Games with Python & Pygame and more books
Page 5 – Hacking Secret Ciphers with Python and more books
Page 6 – Learn Python, Break Python and more books
Page 7 – Modeling Creativity: Case Studies in Python and more books
Page 8 – Python in Hydrology and more books
Page 9 – Tiny Python 3.6 Notebook and more books
All books in this series:
Free Programming Books | |
---|---|
Ada | ALGOL-like programming language, extended from Pascal and other languages |
Agda | Dependently typed functional language based on intuitionistic Type Theory |
Arduino | Inexpensive, flexible, open source microcontroller platform |
Assembly | As close to writing machine code without writing in pure hexadecimal |
Awk | Versatile language designed for pattern scanning and processing language |
Bash | Shell and command language; popular both as a shell and a scripting language |
BASIC | Beginner’s All-purpose Symbolic Instruction Code |
C | General-purpose, procedural, portable, high-level language |
C++ | General-purpose, portable, free-form, multi-paradigm language |
C# | Combines the power and flexibility of C++ with the simplicity of Visual Basic |
Clojure | Dialect of the Lisp programming language |
ClojureScript | Compiler for Clojure that targets JavaScript |
COBOL | Common Business-Oriented Language |
CoffeeScript | Transcompiles into JavaScript inspired by Ruby, Python and Haskell |
Coq | Dependently typed language similar to Agda, Idris, F* and others |
Crystal | General-purpose, concurrent, multi-paradigm, object-oriented language |
CSS | CSS (Cascading Style Sheets) specifies a web page’s appearance |
D | General-purpose systems programming language with a C-like syntax |
Dart | Client-optimized language for fast apps on multiple platforms |
Dylan | Multi-paradigm language supporting functional and object-oriented coding |
ECMAScript | Best known as the language embedded in web browsers |
Eiffel | Object-oriented language designed by Bertrand Meyer |
Elixir | Relatively new functional language running on the Erlang virtual machine |
Erlang | General-purpose, concurrent, declarative, functional language |
F# | Uses functional, imperative, and object-oriented programming methods |
Factor | Dynamic stack-based programming language |
Forth | Imperative stack-based programming language |
Fortran | The first high-level language, using the first compiler |
Go | Compiled, statically typed programming language |
Groovy | Powerful, optionally typed and dynamic language |
Haskell | Standardized, general-purpose, polymorphically, statically typed language |
HTML | HyperText Markup Language |
Icon | Wide variety of features for processing and presenting symbolic data |
J | Array programming language based primarily on APL |
Java | General-purpose, concurrent, class-based, object-oriented, high-level language |
JavaScript | Interpreted, prototype-based, scripting language |
Julia | High-level, high-performance language for technical computing |
Kotlin | More modern version of Java |
LabVIEW | Designed to enable domain experts to build power systems quickly |
LaTeX | Professional document preparation system and document markup language |
Lisp | Unique features - excellent to study programming constructs |
Logo | Dialect of Lisp that features interactivity, modularity, extensibility |
Lua | Designed as an embeddable scripting language |
Markdown | Plain text formatting syntax designed to be easy-to-read and easy-to-write |
Objective-C | Object-oriented language that adds Smalltalk-style messaging to C |
OCaml | The main implementation of the Caml language |
Pascal | Imperative and procedural language designed in the late 1960s |
Perl | High-level, general-purpose, interpreted, scripting, dynamic language |
PHP | PHP has been at the helm of the web for many years |
PostScript | Interpreted, stack-based and Turing complete language |
Prolog | A general purpose, declarative, logic programming language |
PureScript | Small strongly, statically typed language compiling to JavaScript |
Python | General-purpose, structured, powerful language |
QML | Hierarchical declarative language for user interface layout - JSON-like syntax |
R | De facto standard among statisticians and data analysts |
Racket | General-purpose, object-oriented, multi-paradigm, functional language |
Raku | Member of the Perl family of programming languages |
Ruby | General purpose, scripting, structured, flexible, fully object-oriented language |
Rust | Ideal for systems, embedded, and other performance critical code |
Scala | Modern, object-functional, multi-paradigm, Java-based language |
Scheme | A general-purpose, functional language descended from Lisp and Algol |
Scratch | Visual programming language designed for 8-16 year-old children |
SQL | Access and manipulate data held in a relational database management system |
Standard ML | General-purpose functional language characterized as "Lisp with types" |
Swift | Powerful and intuitive general-purpose programming language |
Tcl | Dynamic language based on concepts of Lisp, C, and Unix shells |
TeX | Markup and programming language - create professional quality typeset text |
TypeScript | Strict syntactical superset of JavaScript adding optional static typing |
Vala | Object-oriented language, syntactically similar to C# |
VHDL | Hardware description language used in electronic design automation |
VimL | Powerful scripting language of the Vim editor |
XML | Rules for defining semantic tags describing structure ad meaning |