This repository contains my implementations of several projects from The Big Book of Small Python Projects by Al Sweigart. This curated collection of simple Python projects allows you to dive right in and create digital art, games, animations, number-crunching tools, and more.
The book by Al Sweigart is a fantastic resource for anyone looking to develop their Python skills through hands-on projects. Al's approach of learn-by-doing is incredibly effective, and his decision to make the book available for free is a huge benefit to many aspiring programmers. I highly recommend checking it out here.
Here are the projects I've completed:
- Project 01: Beagels
- Project 02: Birthday Paradox
- Project 03: Bitmap Message
- Project 04: Blackjack
- Project 05: Bouncing DVD Logo
- Project 06: Caesar Cipher
- Project 07: Caesar Hacker
- Project 08: Calendar Maker
- Project 10: Cho Han
- Project 12: Collatz Sequence
- Project 13: Conway's Game of Life
- Project 14: Countdown
- Project 15: Deep Cave
- Project 26: Fibonacci
- Project 46: Million Dice Roll Statistics Simulation
- Project 48: Monty Hall Problem
- Project 52: Numeral System Problems
- Project 64: Seven Segment Display Module
- Project 66: Simple Substitution Cipher
- Project 80: Vigenère Cipher
All projects were implemented using Python version 3.11.4 and are functioning as proposed in the book, with some improvements.
The directory structure is as follows:
base_dir/project-n-name/main.py
Where n
is the project number in the book and name
is the name of the project.
- For projects that require extra libraries, a
requirements.txt
file is included in the project folder. - Each project includes the following functions:
These functions help maintain a clean terminal and ensure proper initialization and termination of the project. The main logic is encapsulated in the
def clear_terminal() -> None: """Clears the terminal.""" os.system('cls' if os.name == 'nt' else 'clear') if __name__ == "__main__": try: main() except KeyboardInterrupt: print("\n-------|-----|-------\nExecution Interrupted\n-------|-----|-------\n")
main
function, with various global functions called withinmain
.
The primary purpose of this repository is to serve as a backup and to showcase these projects. I do not intend to make any further changes, nor am I seeking contributions. These projects are simple and free for anyone to copy and use.
Feel free to explore the projects and use them as you wish!