A collection of 35+ standalone Python scripts covering data structures, algorithms, OOP, cryptography, validation, and CLI tools — built as hands-on practice across a wide range of core Python concepts.
| File | Description |
|---|---|
caeser.py |
Caesar cipher with interactive encrypt/decrypt loop. Preserves case and non-alphabetic characters. Handles wrap-around using modulo arithmetic. |
String_tools.py |
Three string utilities in one CLI: ROT-13 encryption, palindrome checker (strips non-alphanumeric chars), and string reverser. |
Password_Generator.py |
Cryptographically secure password generator using secrets. Configurable length, digit count, special character count, uppercase and lowercase minimums. Retries until all constraints are satisfied. |
Passsword_Strength.py |
Password strength checker — rates passwords as Weak, Moderate, or Strong based on length, digits, uppercase, lowercase, and special characters. |
Credit_card_finder.py |
Validates credit card numbers using the Luhn algorithm. Identifies card network (Visa, Mastercard, Amex, Discover) from the card prefix. |
| File | Description |
|---|---|
binary_search.py |
Binary search with path tracking — returns the list of values visited before finding the target. |
Merge_sort_algo.py |
In-place merge sort implementation with recursive divide-and-conquer. |
quick_sort.py |
Quicksort using a three-way partition (less / equal / greater) to correctly handle duplicate values. |
dijkstra_algo.py |
Dijkstra's shortest path algorithm on a weighted adjacency-list graph. Prints distances from the start node to all others. |
Recursion_Tower_of_hannoi.py |
Tower of Hanoi solver with configurable disc count. Prints the state of all three pegs after each move. |
hashtable.py |
Hash table built from scratch using ASCII-sum hashing with chained collision handling. Supports add, remove, and lookup. |
linked_list.py |
Singly linked list with inner Node class. Supports add, remove, and empty check. |
Tree_traversal_bst.py |
Binary Search Tree with insert, search, delete (with in-order successor replacement), and in-order traversal. |
| File | Description |
|---|---|
polygon_area_calc.py |
Rectangle and Square classes with area, perimeter, diagonal, ASCII picture render, and "how many fit inside" calculation. Square overrides setters to keep width/height in sync. |
game_char_stats.py |
RPG character class using @property with clamped health (0–100) and mana (0–50) setters. Supports level-up with stat reset. |
planet_class.py |
Planet class with type and star validation. Raises TypeError and ValueError on bad input. |
salary_tracker.py |
Employee class with promotion logic enforced via property setters. Prevents salary decrease and invalid level assignments. |
media_catalogue.py |
Movie and TVSeries classes with input validation. MediaCatalogue stores both types and prints them in separate sections. Uses a custom MediaError exception. |
email_simulator.py |
User, Email, and Inbox classes simulating sending, receiving, reading, and deleting emails with timestamps and read/unread status. |
musical_instrument_inventory.py |
Simple MusicalInstrument class demonstrating basic OOP with play() and get_fact() methods. |
RPG_charecter.py |
RPG character creator with stat validation (total must equal 7, each stat 1–4). Renders stats as filled/empty dot bars. |
player_interface.py |
Abstract Player base class with random movement and path tracking. Pawn subclass gains diagonal moves on level_up(). Includes 5 built-in assertion tests. |
discount_calculator.py |
Strategy pattern for discount calculation. Three strategies: percentage, fixed amount, and premium user discount. DiscountEngine picks the best (lowest) price. |
| File | Description |
|---|---|
Time_Calculator.py |
Adds a duration to a 12-hour clock time. Returns the new time with AM/PM, optional day name, and a "(next day)" or "(N days later)" label. |
Arthmetic_formatter.py |
Formats a list of arithmetic problems vertically aligned (like a written exam). Optionally shows the computed answer below the dashes. |
Case_Converter.py |
Converts PascalCase or camelCase strings to snake_case using a list comprehension. |
mini_budget_app.py |
Budget category tracker with deposit, withdraw, transfer, balance check, and a horizontal bar chart (create_spend_chart) showing percentage spent per category. |
Square_root_calculator(approx).py |
Approximate square root via bisection method. Configurable tolerance and max iteration count. |
Pin_extractor.py |
Extracts a hidden PIN from a poem — the nth digit is the length of the nth word in the nth line. |
String_tools.py |
(See Cryptography section above) |
performance review filter.py |
CSV-style employee review processor. Supports filter by score, filter by department, top performer per department, and top performers overall — using filter, map, sorted, and lambda. |
user_config_manager.py |
Key-value settings manager with add, update, delete, and view operations. All keys and values are normalized to lowercase. |
| File | Description |
|---|---|
ISBN_validator.py |
Validates ISBN-10 and ISBN-13 codes including check digit calculation. Handles the ISBN-10 X check digit edge case. |
Medical_data_validator.py |
Validates a list of patient records against format rules using re.fullmatch. Reports each invalid field with its position and value. |
| File | Description |
|---|---|
Bank_management.py |
Full bank management CLI backed by MySQL. Features: signup/login, open account, deposit, withdraw, balance enquiry, customer details, contact update, account closure, view all accounts. Uses PrettyTable for formatted output. Credentials loaded from a gitignored Data.py file. |
Most scripts are self-contained and run with no dependencies:
python binary_search.py
python Soduko_Solver.py
python quick_sort.pyScripts with a CLI menu will prompt for input on launch:
python caeser.py
python Password_Generator.py
python Credit_card_finder.pyInstall these for the projects that need them:
pip install prettytable mysql-connector-pythonBank_management.py also requires a running MySQL instance and a Data.py file (gitignored) with your credentials:
# Data.py
DB_HOST = "localhost"
DB_USER = "your_user"
DB_PASSWORD = "your_password"Python_small_projects/
├── Algorithms & Data Structures
│ ├── binary_search.py
│ ├── Merge_sort_algo.py
│ ├── quick_sort.py
│ ├── dijkstra_algo.py
│ ├── Recursion_Tower_of_hannoi.py
│ ├── hashtable.py
│ ├── linked_list.py
│ └── Tree_traversal_bst.py
│
├── OOP
│ ├── polygon_area_calc.py
│ ├── game_char_stats.py
│ ├── planet_class.py
│ ├── salary_tracker.py
│ ├── media_catalogue.py
│ ├── email_simulator.py
│ ├── musical_instrument_inventory.py
│ ├── RPG_charecter.py
│ ├── player_interface.py
│ └── discount_calculator.py
│
├── Cryptography & Security
│ ├── caeser.py
│ ├── String_tools.py
│ ├── Password_Generator.py
│ ├── Passsword_Strength.py
│ └── Credit_card_finder.py
│
├── CLI Tools & Utilities
│ ├── Time_Calculator.py
│ ├── Arthmetic_formatter.py
│ ├── Case_Converter.py
│ ├── mini_budget_app.py
│ ├── Square_root_calculator(approx).py
│ ├── Pin_extractor.py
│ ├── performance review filter.py
│ └── user_config_manager.py
│
├── Validation
│ ├── ISBN_validator.py
│ └── Medical_data_validator.py
│
├── Database
│ └── Bank_management.py
│
├── Sudoku
│ └── Soduko_Solver.py
│
└── .gitignore
OOP · Inheritance · Abstract classes · Properties & setters · Custom exceptions · Recursion · Binary search · Merge sort · Quicksort · Dijkstra's algorithm · BST · Hash tables · Linked lists · Caesar cipher · ROT-13 · Luhn algorithm · ISBN validation · Regex · Strategy pattern · Lambda / filter / map · MySQL · Bisection method · Modulo arithmetic
MIT License — free to use, modify, and distribute.