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.
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 – How to Make Mistakes in Python and more books
Page 7 – Text Processing in Python and more books
Page 8 – The Coder’s Apprentice and more books
Page 9 – Building Skills in Object-Oriented Design and more books
All books in this series:
|Free Programming Books|
|Java||General-purpose, concurrent, class-based, object-oriented, high-level language|
|C||General-purpose, procedural, portable, high-level language|
|Python||General-purpose, structured, powerful language|
|C++||General-purpose, portable, free-form, multi-paradigm language|
|C#||Combines the power and flexibility of C++ with the simplicity of Visual Basic|
|PHP||PHP has been at the helm of the web for many years|
|HTML||HyperText Markup Language|
|SQL||Access and manipulate data held in a relational database management system|
|Ruby||General purpose, scripting, structured, flexible, fully object-oriented language|
|Assembly||As close to writing machine code without writing in pure hexadecimal|
|Swift||Powerful and intuitive general-purpose programming language|
|Groovy||Powerful, optionally typed and dynamic language|
|Go||Compiled, statically typed programming language|
|Pascal||Imperative and procedural language designed in the late 1960s|
|Perl||High-level, general-purpose, interpreted, scripting, dynamic language|
|R||De facto standard among statisticians and data analysts|
|COBOL||Common Business-Oriented Language|
|Scala||Modern, object-functional, multi-paradigm, Java-based language|
|Fortran||The first high-level language, using the first compiler|
|Scratch||Visual programming language designed for 8-16 year-old children|
|Lua||Designed as an embeddable scripting language|
|Logo||Dialect of Lisp that features interactivity, modularity, extensibility|
|Rust||Ideal for systems, embedded, and other performance critical code|
|Lisp||Unique features - excellent to study programming constructs|
|Ada||ALGOL-like programming language, extended from Pascal and other languages|
|Haskell||Standardized, general-purpose, polymorphically, statically typed language|
|Scheme||A general-purpose, functional language descended from Lisp and Algol|
|Prolog||A general purpose, declarative, logic programming language|
|Forth||Imperative stack-based programming language|
|Clojure||Dialect of the Lisp programming language|
|Julia||High-level, high-performance language for technical computing|
|Awk||Versatile language designed for pattern scanning and processing language|
|BASIC||Beginner’s All-purpose Symbolic Instruction Code|
|Erlang||General-purpose, concurrent, declarative, functional language|
|VimL||Powerful scripting language of the Vim editor|
|OCaml||The main implementation of the Caml language|
|ECMAScript||Best known as the language embedded in web browsers|
|Bash||Shell and command language; popular both as a shell and a scripting language|
|LaTeX||Professional document preparation system and document markup language|
|TeX||Markup and programming language - create professional quality typeset text|
|Arduino||Inexpensive, flexible, open source microcontroller platform|
|Elixir||Relatively new functional language running on the Erlang virtual machine|
|F#||Uses functional, imperative, and object-oriented programming methods|
|Tcl||Dynamic language based on concepts of Lisp, C, and Unix shells|
|Factor||Dynamic stack-based programming language|
|Eiffel||Object-oriented language designed by Bertrand Meyer|
|Agda||Dependently typed functional language based on intuitionistic Type Theory|
|Icon||Wide variety of features for processing and presenting symbolic data|
|XML||Rules for defining semantic tags describing structure ad meaning|
|Vala||Object-oriented language, syntactically similar to C#|
|Standard ML||General-purpose functional language characterized as "Lisp with types"|
|D||General-purpose systems programming language with a C-like syntax|
|Dart||Client-optimized language for fast apps on multiple platforms|
|Markdown||Plain text formatting syntax designed to be easy-to-read and easy-to-write|
|Kotlin||More modern version of Java|
|Objective-C||Object-oriented language that adds Smalltalk-style messaging to C|