Learn to Program. For Free.

Learning to program makes you a smarter and more capable human being. Rocket science uses programming, but programming isn't rocket science. Whether you're a student preparing for a software career, an office worker with a folder full of spreadsheet files, or a hobbyist who wants to make video games, the Python programming language is an excellent start in the world of programming.

I'm Al Sweigart, and I write books to teach beginners to code. I put them online for free because programming is too valuable and needs to be accessible to all. (You can also buy print and ebooks versions.) My approach takes out the intimidation so that you can become productive and enjoy the creative aspects of coding.

Get started today. And good luck on your programming journey!

New Book: "The Big Book of Small Python Projects"

This curated collection of simple Python projects lets you dive right in and make digital art, games, animations, number-crunching tools and more – right away! Forget standard step-by-step tutorials; instead, author Al Sweigart takes a learn-by-doing approach that provides you with over 80 programs to manually copy, run, and play with. Once you see how the code works, it’s time to experiment with your own changes and practice re-creating them yourself.
Cover image of The Big Book of Small Python Projects

New Book: "Beyond the Basic Stuff with Python"

You've read a beginner resource like Automate the Boring Stuff with Python or Python Crash Course, but still don't feel like a "real" programmer? Beyond the Basic Stuff covers software development tools and best practices so you can code like a professional.
Cover image of Beyond the Basic Stuff with Python

Programming Books by Al Sweigart


"Introductions to Python are easy to find. But at the end of the day most Python tutorials for beginners end up being the same lessons repackaged, often leaving the new programmer with gaping holes in how their newly acquire skills can be applied practically. This is not one of those books. Where this book stands out is the second part where you actually build useful tools you might need to use every day. The author does a fantastic job of bridging the concepts and skills you learned earlier to real world applications."

Nicholas Sarlo Read full Amazon review

"This book is totally appropriate for someone who has never programmed before. Everything is explained, right from the ground up, in a lively, interesting style which doesn't dumb things down."

J. Hartley, tartley.com Read full Amazon review

"I am a college professor who occasionally teaches courses for liberal arts students. [...] I offered a game programming course in the Python programming language using Sweigart's book. The students loved this book. It starts at the very beginning and leads them, game by fascinating game, to become highly capable programmers."

Dr. Robert C. Gann Read full Amazon review

"I'm halfway through this book and very pleased. I have never seen a programming book so accessible to complete beginners. It really gave me the jump start I needed. I use it alongside other resources, but it continues to be the easiest to absorb."

Jared Walters Read full Amazon review

"I used to write a column on a greek magazine about learning Python and PyGame. [...] Since I found this book, every time the topic of learning programming is mentioned - especially from a person interested on making games - I point people to it."

Konstantinos Michalopoulos Read full Amazon review

"It is difficult to write a clear and easy to understand book on programming for a beginner. It is even more difficult to write a clear and understandable book on cryptography for a beginner. To do both at the same time is nearly impossible, but this author has nailed it."

jstine Read full Amazon review

"My name is Felix. I'm ten years old, and I really liked your book on game programming with python."

Felix D. (in an email to the author)

Cover of Automate the Boring Stuff with Python

Everyone in the 21st century needs to learn to code, right? But not everyone needs to become a software engineer or computer scientist. Automate the Boring Stuff with Python is written for office workers, students, administrators, and anyone who uses a computer how to write small, practical programs to automate tasks on their computer.

You don't need to know all the complexities of algorithms and syntax, you just want to write basic programs to automate mundane computer tasks. In the process, even total beginners will learn to use Python to control their computers without having to learn complex information about computer science. This is a practical programming guide for the rest of us.

You can also take the online course of this book on Udemy. Use this link to purchase the course for about $14 (about a 70% discount!)

Purchase the print book directly from the publisher to receive PDF, Kindle, and epub ebook downloads for free.

Cover of Beyond the Basic Stuff with Python

You've completed a basic Python programming tutorial or finished Al Sweigart's best selling Automate the Boring Stuff with Python. What's the next step toward becoming a capable, confident software developer?

Welcome to Beyond the Basic Stuff with Python. More than a mere collection of advanced syntax and masterful tips for writing clean code, you'll learn how to advance your Python programming skills by using the command line and other professional tools like code formatters, type checkers, linters, and version control. Sweigart takes you through best practices for setting up your development environment, naming variables, and improving readability, then tackles documentation, organization and performance measurement, as well as object-oriented design and the Big-O algorithm analysis commonly used in coding interviews. The skills you learn will boost your ability to program—not just in Python but in any language.

You can get a free review copy of this ebook!

Cover of Coding with Minecraft

You've mined for diamonds, crafted dozens of tools, and built all sorts of structures—but what if you could program robots to do all of that for you in a fraction of the time?

In Coding with Minecraft, you'll create a virtual robot army with Lua, a programming language used by professional game developers. Step-by-step coding projects will show you how to write programs that automatically dig mines, collect materials, craft items, and build anything that you can imagine. Along the way, you'll explore key computer science concepts like data types, functions, variables, and more.

Purchase the print book directly from the publisher to receive PDF, Kindle, and epub ebook downloads for free.

You can get a free review copy of this ebook! (Scroll to the bottom of this link for info.)

Cover of Cracking Codes with Python

Cracking Codes with Python teaches complete beginners how to program in the Python programming language. The book features the source code to several ciphers and hacking programs for these ciphers. The programs include the Caesar cipher, transposition cipher, simple substitution cipher, multiplicative & affine ciphers, Vigenere cipher, and hacking programs for each of these ciphers. The final chapters cover the modern RSA cipher and public key cryptography.

Purchase the print book directly from the publisher to receive PDF, Kindle, and epub ebook downloads for free.

You can get a free review copy of this ebook!

Cracking Codes with Python is the new edition of the older book, Hacking Secret Ciphers with Python.

Cover of Invent Your Own Computer Games with Python

Invent Your Own Computer Games with Python teaches you how to program in the Python language. Each chapter gives you the complete source code for a new game, and then teaches the programming concepts from the examples. Games include Guess the Number, Hangman, Tic Tac Toe, and Reversi. This book also has an introduction to making games with 2D graphics using the Pygame framework.

Purchase the print book directly from the publisher to receive PDF, Kindle, and epub ebook downloads for free.

You can get a free review copy of this ebook!

Cover of Scratch Programming Playground

Scratch Programming Playground teaches you how to program in Scratch, the graphical programming language from MIT for ages 8 to 16. It features 8 game and art projects.

Scratch Programming Playground is for young adults or parents/teachers who want to lead kids through a fun programming journey. Additionally, there are also many video tutorials on YouTube from the author's website, Invent with Scratch.

There is also an online Udemy course that follows the book, and you can sign up for free.

Purchase the print book directly from the publisher to receive PDF, Kindle, and epub ebook downloads for free.

You can get a free review copy of this ebook!

Cover of Making Games with Python & Pygame

Making Games with Python & Pygame covers the Pygame library with the source code for 11 games. Making Games was written as a sequel for the same age range as Invent with Python. Once you have an understanding of the basics of Python programming, you can now expand your abilities using the Pygame library to make games with graphics, animation, and sound.

The book features the source code to 11 games. The games are clones of classics such as Nibbles, Tetris, Simon, Bejeweled, Othello, Connect Four, Flood It, and others.

Udemy Online Courses

You can supplement your book reading with Udemy online video courses for "Automate the Boring Stuff with Python" and "Scratch Programming Playground". Use these links to receive large discounts:


All of my books are free to download and share under a Creative Commons license and have been part of Humble Book Bundles benefitting charities. If you'd like to help me out, there are several options:

About Al Sweigart

Al Sweigart is a software developer and tech book author. Python is his favorite programming language, and he is the developer of several open source modules for it. His cat weighs 11 pounds.