This repository contains a collection of small Python programs that demonstrate various programming concepts and techniques. Each program is self-contained and serves as a learning experiment for different aspects of Python programming.
An implementation of Shamir's Secret Sharing cryptographic algorithm for securely splitting and reconstructing secrets.
A demonstration of the Minimax algorithm with Alpha-Beta pruning, commonly used in game AI and decision making.
Examples showing how to use Pydantic for data validation and settings management.
Exploration of Python's dynamic attribute handling using getattr and dict.
Implementation of a shift-reduce parser for processing simple English sentences.
Various examples of Python decorators including timing, logging, and function repetition.
A simple REST API server implementation using FastAPI framework.
A comprehensive guide to Python's dataclasses, demonstrating how to use the @dataclasses.dataclass decorator for simplified class creation with automatic method generation, customization options, and best practices.
The programs may require various Python packages. Install them using:
make
Then setup the virtual environment:
source ./venv/bin/activate
Each program can be run independently. Most programs include example usage in their source code or can be run directly:
python3 <program_name>.py