Mon 22 August 2022

Which Al Sweigart Python Books Should I Start Reading?

Posted by Al Sweigart in misc   

I've been writing programming books for beginners since 2009. All of them are free to read online at InventWithPython.com Readers ask me which of my books they should tackle first, so I wrote this guide to help beginners get started with my free learning materials.

The common types of readers are:

Before diving into the details, there's another common question about learning to program: "What programming language should I learn?" In almost every case, the answer is Python. Python has a gentle learning curve and readable syntax, but it’s also a serious language used by professionals. Many people say it doesn’t matter which language you start with, and they are sort of right. Choosing another language as your first isn’t a “wrong” choice, but Python is so versatile and avoids many common speed bumps found in other languages that I strongly recommend it.

"I am interested in coding and I just want to get started learning to code."

Automate the Boring Stuff with Python, 3rd Edition (read free online, buy print book) is my most popular programming book. The first half covers the basics of programming and the Python language, while the second half focuses on software modules that help with practical tasks such as updating Excel spreadsheets, sending text and email notifications, extracting text from PDFs, scraping data from websites, and more. This book skips most computer science theory and algorithms and instead focuses on getting you to write practical programs that automate boring tasks on your computer.

It's also a solid general programming guide for complete beginners.

Automate the Boring Stuff with Python is free to read on my website AutomateTheBoringStuff.com. This book is ideal for:

  • Adults and teens who want to learn to code
  • Hobbyists, office workers, academic researchers, and administrators, who use computers as part of their job
  • People who find themselves buried in spreadsheets and PDFs
  • Adults interested in changing careers to software engineering but who want a low-pressure place to start

I've also created a 50-video Udemy course that follows most of the content in this book. The first 15 videos are free to watch on YouTube.

After finishing Automate, I recommend moving on to Beyond the Basic Stuff with Python or Eric Matthes' Python Crash Course.

"I want to make video games."

Invent Your Own Computer Games with Python (read free online, buy print book) is for complete beginners and teaches programming by making simple text-based games, with a few graphical games at the end using the Pygame library). Making Games with Python & Pygame (read free online, buy print book) follows up with the source code to several graphical games such as Tetris and Snake and Connect Four. The Big Book of Small Python Projects (read free online, buy print book) follows up with 81 text-based game, simulation, and animation projects.

The game projects in these books aren't like modern video games with 3D graphics, but the simplified video games are fun projects while you learn the basics of programming.

These books are ideal for:

  • Complete beginners who want to learn to program using fun game projects
  • People looking for small programming project ideas
  • People who want to learn the Pygame 2D graphical game library

HHowever, I should caution you against seeking employment in the notoriously abusive and low-paying video game industry. You can still make games—including successful commercial games—without working for a major studio. Stardew Valley, Balatro, Undertale, Vampire Survivors, and Minecraft show that it’s more important for a game to be fun than to have a multi-million-dollar budget.

"I'm interested in hacking and cybersecurity."

Cracking Codes with Python (read free online, buy print book) covers classic ciphers and the cryptanalysis techniques used to break them. You’ll write Python programs that implement ciphers such as the Caesar cipher, transposition cipher, Vigenère cipher, and RSA, as well as programs that can crack these codes.

This book is good for:

  • People new to hacking and cybersecurity
  • People who want to get better at math and programming as part of their tech career
  • Beginner cryptography enthusiasts
  • People who don't want a cybersecurity career but want to learn Python and are intrigued by ciphers and puzzles

"I'm a beginner but not a complete beginner and I'm tired of doing the same "Hello, world" tutorials."

Some people suggest reading open source code to improve your programming skills. I disagree with this advice for beginners: open source projects may not be well documented, often use advanced techniques, and can feel like drinking from a fire hose. I wrote The Big Book of Small Python Projects (read free online, buy print book) to include the source code to projects that are short and simple, but still offer an example of how programming concepts are applied to actual programs.

Beyond the Basic Stuff with Python (read free online, buy print book) covers intermediate and advanced Python techniques, as well as general best practices such as writing functions, naming variables, understanding programming jargon, and using source control with Git and GitHub.

These books are ideal for:

  • Peeople who feel stuck in "tutorial hell", repeating beginner tutorials
  • People who want manageable project ideas
  • People looking for the next step in learning Python

"I love Minecraft and want to get into coding."

Coding with Minecraft (read free online, buy print book) teaches you how to program using the ComputerCraft mod for Minecraft. ComputerCraft adds programmable robots to your Minecraft world, and you can program to mine, build, farm, craft, solve mazes, and more. ComputerCraft uses the Lua scripting language rather than Python.

This book is ideal for:

  • Kids (and parents) who like Minecraft and want to get into programming
  • Teachers or instructors who run after school coding clubs.

You may also want to check out Programming with Minecraft.

"I want to get my kids into programming."

Scratch 3 Programming Playground (read free online, buy print copy) cover's the Scratch programming environment tool. Scratch is a free, graphical programming environment from MIT. It teaches 8- to 16-year-olds programming by snapping code blocks together to form complete programs. You can learn more about what Scratch is and read information for parents.

Also check out Coding with Minecraft (read free online, buy print book).

I also have a free Udemy course that covers Scratch, although as of 2022 it still covers version 2 of the Scratch editor instead of the current version 3.

"I'm super ambitious about learning to code and I want to read all of your books! What order should I read them?"

If you want to read all of these books, here's the order to tackle them:

  1. Automate the Boring Stuff with Python for basic programming concepts.
  2. Invent Your Own Computer Games with Python for detailed tutorials for making game projects.
  3. The Big Book of Small Python Projects for experience creating a wide variety of programming projects.
  4. (Optionally) Making Games with Python & Pygame if you want to continue making games.
  5. (Optionally) Cracking Codes with Python if you want to learn Python for cipher projects.
  6. Beyond the Basic Stuff with Python to learn intermediate and advanced software development skills.
  7. The Recursive Book of Recursion to learn computer science by exploring recursive programming techniques.

"What are your books for complete beginners?"

To recap, here are my books for those with no programming experience:

There are more free resources than ever to learn to code. Good luck on your programming journey!


Check out other books by Al Sweigart, free online or available for purchase:

...and other books as well! Or register for the online video course. You can also donate to or support the author directly.