Skip to content

ShehrozAI1000/Automated-Grocery-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

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.

About

A simple Python script to manage grocery inventory using lists and bubble sort.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages