The Big Book of Small Python Projects

Author: Al Sweigart
Publisher: No Starch Press
Date: June 2021
Pages: 432
ISBN: 978-1718501249
Print: 1718501242
Kindle: B08FH9FV7M
Audience: Novice Python developers
Rating: 4
Reviewer: Lucy Black
A project book? A good way to learn Python?

You really only can learn to program by doing it. Theory is good, but only as backing for the practical. Most of the programmers I know love to program, but they tend to love to program things that they have thought up for themselves - a missing something or other or a better something else. This is often what fires the passion to learn to program. It is not that you want to be a carpenter. It's that you want to build a table.

Banner

So it is with programming, but what if you are encouraged to build someone else's table? This is the premise of The Big Book of Small Python Projects. It provides a set of small precise projects and implementations, or solutions if you like. Of course, the big problem is that these are someone else's projects and someone else's solution. How useful you find this book depends very much on how you react to this situation - if you are a  teacher you could use the book to impose the projects on your class or let the students choose a project title and then see how someone else does the job.

 

What is important is what the projects are about. You need to identify at least one, and probably more, that interest you to make the book worth contemplating. There are 81 projects ranging across math, animation, games, ciphers and so on. I make no apology for quoting the entite list:

Project 1, Bagels: Deduce a secret three-digit number based on clues.
Project 2, Birthday Paradox: Determine the probability that two
people share the same birthday in groups of different sizes.
Project 3, Bitmap Message: Display a message on the screen configured by a 2D bitmap image.
Project 4, Blackjack: A classic card game played against an AI dealer.
Project 5, Bouncing DVD Logo: Simulates the colorful bouncing DVD
Project 6, Caesar Cipher: A simple encryption scheme used thousands of years ago.
Project 7, Caesar Hacker: A program to decrypt Caesar cipher
messages without the encryption key.
Project 8, Calendar Maker: Create calendar pages for a given year and month.
Project 9, Carrot in a Box: A silly bluffing game between two players.
Project 10, Cho-Han: A gambling dice game from feudal Japan.
Project 11, Clickbait Headline Generator: A humorous headline generator for your content farm.
Project 12, Collatz Sequence: Explore the simplest impossible conjecture in mathematics.
Project 13, Conway’s Game of Life: The classic cellular automata whose simple rules produce complex emergent behavior.
Project 14, Countdown: A countdown timer with a seven-segment display.
Project 15, Deep Cave: A tunnel animation that descends endlessly into the earth.
Project 16, Diamonds: An algorithm for drawing diamonds of various sizes.
Project 17, Dice Math: A visual dice-rolling math game.
Project 18, Dice Roller: A tool for reading Dungeons & Dragons dice notation to generate random numbers.
Project 19, Digital Clock: A clock with a calculator-like display.
Project 20, Digital Stream: A scrolling screensaver that resembles The Matrix.
Project 21, DNA Visualization: An endless ASCII-art double helix that demonstrates the structure of DNA.
Project 22, Ducklings: Mix and match strings to create a variety of ASCII-art ducks.
Project 23, Etching Drawer: Move the cursor to create line drawings.
Project 24, Factor Finder: Find all the multiplicative factors of a number.
Project 25, Fast Draw: Test your reflexes to see if you’re the fastest keyboard in the West.
Project 26, Fibonacci: Generate numbers in the famous Fibonacci sequence.
Project 27, Fish Tank: A colorful, animated ASCII-art fish tank.
Project 28, Flooder: Attempt to fill the entire puzzle board with one color.
Project 29, Forest Fire Sim: Simulate the spread of wildfires through a forest.
Project 30, Four in a Row: A board game where two players try
to connect four tiles in a row.
Project 31, Guess the Number: The classic number guessing game.
Project 32, Gullible: A humorous program to keep gullible people
busy for hours.
Project 33, Hacking Minigame: Deduce a password based on clues.
Project 34, Hangman and Guillotine: The classic word guessing game.
Project 35, HProject 36, Hourglass: A simple physics engine for falling sand.
Project 37, Hungry Robots: Avoid killer robots in a maze.
Project 38, J’Accuse!: A detective game to determine liars and truth-tellers.
Project 39, Langton’s Ant: A cellular automata whose ants move
according to simple rules.
Project 40, Leetspeak: Translate English messages into l33t5p34]<.
Project 41, Lucky Stars: A push-your-luck dice game.
Project 42, Magic Fortune Ball: A program to answer your yes/no
questions about the future.
Project 43, Mancala: The ancient two-player board game
from Mesopotamia.
Project 44, Maze Runner 2D: Try to escape a maze.
Project 45, Maze Runner 3D: Try to escape a maze . . . in 3D!
Project 46, Million Dice Roll Statistics Simulator: Explore the
probability results of rolling a set of dice one million times. .
Project 47, Mondrian Art Generator: Create geometric drawings
in the style of Piet Mondrian.
Project 48, Monty Hall Problem: A simulation of the Monty Hall
game show problem.
Project 49, Multiplication Table: Display the multiplication
table up to 12 × 12. 245
Project 50, Ninety-Nine Bottles: Display the lyrics to a repetitive song.
Project 51, niNety-nniinE BoOttels: Display the lyrics to a repetitive song that get more distorted with each verse.
Project 52, Numeral Systems Counters: Examine binary and
hexadecimal numbers.
Project 53, Periodic Table of the Elements: An interactive database of chemical elements.
Project 54, Pig Latin: Translates English messages into Igpay Atinlay.
Project 55, Powerball Lottery: Simulate losing at the lottery
thousands of times.
Project 56, Prime Numbers: Calculate prime numbers.
Project 57, Progress Bar: A sample progress bar animation to use in other programs.
Project 58, Rainbow: A simple rainbow animation.
Project 59, Rock Paper Scissors: The classic hand game
for two players.
Project 60, Rock Paper Scissors (Always-Win Version):
A version of the game where the player cannot lose.
Project 61, ROT13 Cipher: The simplest cipher for encrypting
and decrypting text.
Project 62, Rotating Cube: A rotating cube animation.
Project 63, Royal Game of Ur: A 5,000-year-old game
from Mesopotamia.
Project 64, Seven-Segment Display Module: A display like
those used in calculators and microwave ovens.
Project 65, Shining Carpet: Programmatically generate the
carpet from The Shining.
Project 66, Simple Substitution Cipher: An encryption scheme
more advanced than the Caesar cipher.
Project 67, Sine Message: Display a scrolling wave message.
Project 68, Sliding Tile Puzzle: The classic four-by-four tile puzzle.
Project 69, Snail Race: Fast-paced snail racing action!
Project 70, Soroban Japanese Abacus: A computer simulation
of a pre-computer calculating tool.
Project 71, Sound Mimic: Memorize an increasingly long
pattern of sounds.
Project 72, sPoNgEcAsE: Translates English messages into
sPOnGEcAsE.
Project 73, Sudoku Puzzle: The classic nine-by-nine newspaper
deduction puzzle.
Project 74, Text-to-Speech Talker: Make your computer
talk to you!
Project 75, Three-Card Monte: The tricky fast-swapping card
game that scammers play on tourists.
Project 76, Tic-Tac-Toe: The classic two-player board game
of Xs and Os.
Project 77, Tower of Hanoi: The classic disk-
stacking puzzle.
Project 78, Trick Questions: A quiz of simple questions with
misleading answers.
Project 79, Twenty Forty-Eight: A casual tile matching game.
Project 80, Vigenère Cipher: An encryption scheme so advanced it remained unbreakable for hundreds of years until computers were invented.
Project 81, Water Bucket Puzzle: Obtain exactly four liters of
water by filling and emptying three buckets.

I need to add that the presentation follows a standard pattern:

Statement of problem - this is on a separate page with an illustration

Program in action - Instructions to run the program

How it works - program listing with numbered lines. Programs typically consist of fewer than a hundred line and many of them involve calling a library

Exploring the program - suggests modifications to the code and asks pertinent questions

 

For me the weakest part is the "How it works" sections. These are little more than the presentation of the program and a brief description. I would also like a discussion of how the programmer thought about the problem before launching on a solution and more discussion of the inner processes that go on when you are writing a program. There simply isn't enough insight presented clearly for you to learn from.

Verdict: If you aren't happy learning by doing then you probably won't get much from this book. Even so it's worth buying if any of the projects spark your imagination - or if you are looking for projects to hand out to a class.

To keep up with our coverage of books for programmers, follow @bookwatchiprog on Twitter or subscribe to I Programmer's Books RSS feed for each day's new addition to Book Watch and for new reviews.

Banner


SQL Server 2017 Query Performance Tuning, 5th Ed

Author: Grant Fritchey
Publisher: Apress
Pages: 966
ISBN: 978-1484238875
Print: 1484238877
Kindle: B07H49LN75
Audience: DBAs and developers
Rating: 4.7
Reviewer: Ian Stirk

A popular performance tuning book gets updated for SQL Server 2017, how does it fare?



Murach's MySQL 3rd Edition

Author: Joel Murach
Publisher: Mike Murach
Pages: 628
ISBN: 978-1943872367
Print: 1943872368
Audience: MySQL developers
Rating: 5
Reviewer: Kay Ewbank

This new edition of a popular title brings the material up to date to cover MySQL 8, and covers newer MySQL features such as window functions, Commo [ ... ]


More Reviews

Last Updated ( Saturday, 14 August 2021 )