Haz clic aquí para ver el README en español
This Python program helps manage a store's inventory efficiently. It provides functionalities to add, search, update, delete products, and calculate the total value of the inventory.
- Add products: Allows adding new products with their name, price, and quantity.
- Search products: Search for a product by its name and view its details (price and quantity).
- Update product prices: Change the price of an existing product.
- Delete products: Remove products from the inventory.
- Calculate inventory value: Calculate the total value of all products in stock.
- The program uses functions to handle each operation (adding, searching, updating, and deleting products).
- Products are stored in a dictionary, where the product name is the key, and the price and quantity are stored as a tuple.
- The total value of the inventory is calculated using a lambda function.
validate_product_name: Validates and formats product names (max 25 characters, only letters and spaces).validate_product_price: Validates the product price (positive float, max 1,000,000,000).validate_product_quantity: Validates the product quantity (positive integer, max 100,000,000).add_product: Adds a product to the inventory if it does not already exist.search_product: Searches for a product by name and displays its details.update_product_price: Updates the price of an existing product.delete_product: Deletes a product from the inventory.menu: Displays the menu options for the user to choose from.main: The main function that controls the flow of the program.
- The program will repeatedly ask the user to select an operation until they choose to exit.
- For each operation, the user will be prompted to enter the necessary details.
- If any input is invalid, the program will ask the user to enter the correct information.
- The program calculates and displays the total inventory value when requested.
- Python 3.x or higher.
You will be prompted to choose from the following options:
- Add product
- Search product
- Update price
- Delete product
- Show total inventory value
- Exit
To use the program, simply clone this repository and run the inventory_management.py script.
git clone https://github.com/yourusername/inventory-management.git
cd inventory-management
python inventory_management.pyThis project is licensed under the MIT License - see the LICENSE file for details.