What this program does View All Items: It prints all the items in the grocery list using a function. Add New Items: You can type any new item, and the program adds it to the list. Sort Items: I wrote a Bubble Sort function to put all items in alphabetical (A to Z) order. Top 3 Items: I used list slicing to show only the first three items. Menu System: I used a while loop so the user can choose options from 1 to 5. How I built the logic Inventory List: I started with a list that has items like Milk, Apple, and Bread. Functions: I created a function called show_items with a parameter to print the list easily. Manual Sorting: I did not use the built-in sort. Instead, I used two for loops and an if statement to compare and swap items manually. User Choice: I used input() and if/elif statements so the user can control the program. How to use it Run the script and follow the menu: Press 1 to see the items. Press 2 to add a new item. Press 3 to sort the list and see it. Press 4 to see the first three items. Press 5 to exit the program.
ShehrozAI1000/Automated-Grocery-Manager
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|