The Big Book of Small Python Projects

Book description

If you’ve mastered basic Python syntax and you’re ready to start writing programs, you’ll find The Big Book of Small Python Projects both enlightening and fun. This collection of 81 Python projects will have you making digital art, games, animations, counting pro- grams, and more right away. Once you see how the code works, you’ll practice re-creating the programs and experiment by adding your own custom touches.

These simple, text-based programs are 256 lines of code or less. And whether it’s a vintage screensaver, a snail-racing game, a clickbait headline generator, or animated strands of DNA, each project is designed to be self-contained so you can easily share it online.

You’ll create:

•Hangman, Blackjack, and other games to play against your friends or the computer
•Simulations of a forest fire, a million dice rolls, and a Japanese abacus
•Animations like a virtual fish tank, a rotating cube, and a bouncing DVD logo screensaver
•A first-person 3D maze game
•Encryption programs that use ciphers like ROT13 and Vigenère to conceal text

If you’re tired of standard step-by-step tutorials, you’ll love the learn-by-doing approach of The Big Book of Small Python Projects. It’s proof that good things come in small programs!

Publisher resources

View/Submit Errata

Table of contents

  1. Title Page
  2. Copyright
  3. About the Author
  4. Introduction
  5. Project #1: Bagels
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  6. Project #2: Birthday Paradox
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  7. Project #3: Bitmap Message
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  8. Project #4: Blackjack
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  9. Project #5: Bouncing DVD Logo
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  10. Project #6: Caesar Cipher
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  11. Project #7: Caesar Hacker
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  12. Project #8: Calendar Maker
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  13. Project #9: Carrot in a Box
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  14. Project #10: Cho-Han
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  15. Project #11: Clickbait Headline Generator
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  16. Project #12: Collatz Sequence
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  17. Project #13: Conway’s Game of Life
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  18. Project #14: Countdown
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  19. Project #15: Deep Cave
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  20. Project #16: Diamonds
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  21. Project #17: Dice Math
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  22. Project #18: Dice Roller
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  23. Project #19: Digital Clock
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  24. Project #20: Digital Stream
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  25. Project #21: DNA Visualization
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  26. Project #22: Ducklings
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  27. Project #23: Etching Drawer
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  28. Project #24: Factor Finder
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  29. Project #25: Fast Draw
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  30. Project #26: Fibonacci
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  31. Project #27: Fish Tank
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  32. Project #28: Flooder
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  33. Project #29: Forest Fire Sim
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  34. Project #30: Four in a Row
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  35. Project #31: Guess the Number
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  36. Project #32: Gullible
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  37. Project #33: Hacking Minigame
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  38. Project #34: Hangman and Guillotine
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  39. Project #35: Hex Grid
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  40. Project #36: Hourglass
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  41. Project #37: Hungry Robots
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  42. Project #38: J’Accuse!
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  43. Project #39: Langton’s Ant
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  44. Project #40: Leetspeak
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  45. Project #41: Lucky Stars
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  46. Project #42: Magic Fortune Ball
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  47. Project #43: Mancala
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  48. Project #44: Maze Runner 2D
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  49. Project #45: Maze Runner 3D
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  50. Project #46: Million Dice Roll Statistics Simulator
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  51. Project #47: Mondrian Art Generator
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  52. Project #48: Monty Hall Problem
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  53. Project #49: Multiplication Table
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  54. Project #50: Ninety-Nine Bottles
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  55. Project #51: niNety-nniinE BoOttels
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  56. Project #52: Numeral System Counters
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  57. Project #53: Periodic Table of the Elements
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  58. Project #54: Pig Latin
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  59. Project #55: Powerball Lottery
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  60. Project #56: Prime Numbers
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  61. Project #57: Progress Bar
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  62. Project #58: Rainbow
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  63. Project #59: Rock Paper Scissors
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  64. Project #60: Rock Paper Scissors (Always-Win Version)
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  65. Project #61: ROT13 Cipher
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  66. Project #62: Rotating Cube
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  67. Project #63: Royal Game of Ur
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  68. Project #64: Seven-Segment Display Module
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  69. Project #65: Shining Carpet
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  70. Project #66: Simple Substitution Cipher
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  71. Project #67: Sine Message
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  72. Project #68: Sliding Tile Puzzle
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  73. Project #69: Snail Race
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  74. Project #70: Soroban Japanese Abacus
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  75. Project #71: Sound Mimic
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  76. Project #72: sPoNgEcAsE
    1. tHe PrOgRaM iN AcTiOn
    2. hOw It WoRkS
    3. ExPloRiNg tHe PrOgRaM
  77. Project #73: Sudoku Puzzle
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  78. Project #74: Text-to-Speech Talker
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  79. Project #75: Three-Card Monte
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  80. Project #76: Tic-Tac-Toe
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  81. Project #77: Tower of Hanoi
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  82. Project #78: Trick Questions
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  83. Project #79: Twenty Forty-Eight
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  84. Project #80: Vigenère Cipher
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  85. Project #81: Water Bucket Puzzle
    1. The Program in Action
    2. How It Works
    3. Exploring the Program
  86. Project A: Tag Index
  87. Project B: Character Map
    1. Using the chr() and ord() Functions
    2. Table of Code Points

Product information

  • Title: The Big Book of Small Python Projects
  • Author(s): Al Sweigart
  • Release date: June 2021
  • Publisher(s): No Starch Press
  • ISBN: 9781718501256