A simple Python project that simulates basic stock management operations. It integrates key programming concepts in a practical scenario.
The system allows you to:
- List all products
- Identify out-of-stock items
- Calculate total inventory value
- Filter available promotions
- Search for products with validation and error handling
- Lists, dictionaries, sets, and tuples
- Conditional logic (
if,for) - Set operations
- Exception handling (
try,except,raise,finally)
- Products are stored as a list of dictionaries (
name,price,quantity) - Out-of-stock items are collected in a set
- Total value is calculated using
price × quantity(only in-stock items) - Promotions are filtered using set difference
- User input is validated; empty input raises a
ValueError, and the program always finalizes the search withfinally
--- Inventory --- Rice - $ 5.99 - 50 units ...
--- Out of Stock Products ---
- Beans
- Olive Oil
Total inventory value: $ 787.50
- Rice
- Coffee
- Pasta
Enter the product name: Rice Name: Rice | Price: $ 5.99 | Quantity: 50 --- Search completed ---
python filename.pyPedro Gaudencio