Introduction

Al Sweigart is one of my tech heroes. His videos on Scratch inspired me to code and teach Scratch to hundreds of children. His Automate the Boring Stuff with Python is a bestseller. So when I came across another of his works, with "81 easy practice programs" as subtitle, I wanted to read and review it.

This book is for anyone who knows how to write simple Python programs. Simplicity is a guiding principle.

Code makes up most of each chapter. Since the idea is to learn by typing and running, there is just minimal explanation for each program. That said, most of the projects are interesting, and would make fun projects to implement for anyone looking to go beyond basics.

Unlike other books that one can read chapter-wise, this has 81! Hence, I’ve classified the projects I found interesting into a few buckets:

Cool

  1. Blackjack: Plays the game, has ascii art and Unicode
  2. Flooder: Great game to play + designing for disability!
  3. Four-in-a-row: Connect Four type game in python!
  4. Monty Hall with art - though I always lost when I swapped!
  5. Sliding Tile game

LOL-worthy

  1. Generating Clickbait Headlines
  2. Fast Draw
  3. L3375P34]<
  4. Powerball
  5. Snail Race
  6. Trick Questions

Useful

  1. Seven Segment Display and projects that use it, like Digital Clock
  2. Periodic Table: Wonderful project used to display table and element data

Long/Difficult

  1. Hungry robots: The classic attacker game
  2. Mancala: I know this as pallanguzhi (பல்லாங்குழி), a game played in Tamil Nadu, India
  3. Ur: Ancient Iranian game with a complex board (ascii art again!)
  4. Maze Runner 3D: Using Ascii Art to get 3D perspective!
  5. Rotating 3D cube!
  6. Abacus simulator
  7. Sudoku, 2048 - Long but Cool!

Most of the code, even for the long projects, is simple. As I typed out the programs, I came across a many useful Python nuggets that were new to me.

There were nice bits where ascii art or animations were used to enhance the projects. One of the cool ones was to simulate a printer typing out character by character using the flush parameter of the print function

for char in somestr:
    print(char, flush=True, end="")
    time.sleep(0.1)

Apart from the author-written bext, and pyttsx3 in one project, there is not an extensive use of any third party modules. This is a good thing in a book of this nature as anyone just pickup the book, choose an interesting looking project, and complete it within a few hours.

Every project ends with a few questions for the reader to think about and changes to try out. These help the reader to explore the programs further and gain an understanding of how it works.

Summary

Al’s projects are oriented towards learners - the inclusion of games and fun projects is a testimony. The book will give the beginner the confidence needed to implement their own simple projects and games!

The Big Book of Small Python Projects

Buy the Book

PRO

  • Tags like tiny, large, beginner, word etc help the reader search for relevant projects in the book
  • Well-known games are implemented: sudoku, tic-tac-toe, Rock Paper Scissors, Blackjack, 2048 etc
  • Introduces the Mu IDE - It’s better than IDLE and less complex than VS Code.
  • Quite a few practice enhancements to do after copying the code.
  • A lot of ASCII Art! - calendar, carrot in a box, ducklings, Ur

CON

  • Though the bext module is useful for text graphics, some projects, like Bouncing DVD, don’t add much to a learner. Also, programs that use bext need to be run from a terminal, and not from an IDE like VSCode or Mu or IDLE.
  • There is only minimal explanation of the code. The reader is expected to make changes to the code and explore it to understand how it works
  • Invariably mistakes will be made while typing the code, and the reader is expected to be able to identify the mistake and fix it. If not, it can be frustrating to type a couple of pages of code and then get stuck with an error

Did you like this article?

If you liked this article, consider subscribing to this site. Subscribing is free.

Why subscribe? Here are three reasons:

  1. You will get every new article as an email in your inbox, so you never miss an article
  2. You will be able to comment on all the posts, ask questions, etc
  3. Once in a while, I will be posting conference talk slides, longer form articles (such as this one), and other content as subscriber-only

Tagged in: