A collection of small Python projects built to practice core programming concepts like functions, classes, dictionaries, lists, sets, and file persistence with JSON.
A CLI contact manager that stores contacts in a JSON file.
Concepts: dictionaries, functions, JSON persistence
- Add, update, delete and display contacts
- Duplicate contact detection using
any()
An inventory system for managing a personal book collection.
Concepts: classes, list comprehensions, OOP, JSON persistence
Bookclass with title, genre, year and personal ratingCollectionclass to manage the full inventory- Filter books by genre or year
A personal finance tracker to log and categorize expenses.
Concepts: classes, classmethod, list comprehensions, JSON persistence
Expenseclass withto_dictandfrom_dictmethods for JSON serialization- Group and sum expenses by category
- Includes pytest test suite
A command-line task manager to organize pending work.
Concepts: functions, dictionaries, JSON persistence, datetime
- Add, update, delete and display tasks
- Task status tracking (to do / in progress / done)
- Includes pytest test suite
A simple poll system with duplicate vote prevention.
Concepts: sets, dictionaries, JSON persistence
- Candidates stored in JSON with vote counts
- Voter IDs tracked in a set to prevent double voting
- ID format validation
Analyzes a text file or URL and returns the most frequent words.
Concepts: dictionaries, collections.Counter, functions, requests
- Fetches text directly from a URL using
requests - Uses
Counter.most_common()to find the top 10 words - Includes pytest test suite
A classic number guessing game.
Concepts: loops, conditionals, random
- Random number generation
- Feedback on each guess (too high / too low)
Generates secure random passwords based on user preferences.
Concepts: sets, functions, random, string
- Choose to include letters, numbers and/or symbols
- Configurable password length
Generates barcodes from user input.
Concepts: external libraries, file output
Implementation of the Luhn algorithm to validate credit card numbers.
Concepts: lists, mathematical logic, functions
- Language: Python 3
- Data persistence: JSON
- Testing: pytest
- External libraries:
requests,collections
Clone the repository and navigate to any project folder:
git clone https://github.com/TheMartuu/Python-Basics.git
cd Python-Basics/<project-folder>
python <main_file>.pyTo run tests (where available):
pytest tests/These projects were built as a learning exercise to practice Python fundamentals. Each one focuses on one or more core concepts and grows progressively in complexity.