A Python-based vending machine simulation that allows users to select products, insert money, and receive items with correct change handling.
- Display available products with prices
- User input for item selection
- Accepts money input from user
- Validates sufficient balance
- Dispenses selected item
- Returns remaining change
- Handles invalid inputs gracefully
- Python
- Core Programming (Loops, Conditionals)
- (Optional: OOP if used)
vending_machine/
│── vending_machine.py
│── README.md
-
The system displays a list of available items with prices.
-
The user selects a product.
-
The user inserts money.
-
The system checks:
- If the item exists
- If sufficient balance is provided
-
If valid:
- Item is dispensed
- Remaining change is returned
-
If invalid:
- Error message is shown
git clone https://github.com/your-username/vending-machine.git
cd vending-machine
python vending_machine.py
Welcome to the Vending Machine!
Available Items:
1. Coke - ₹40
2. Chips - ₹20
3. Chocolate - ₹30
Select item: 1
Insert money: ₹50
Dispensing Coke...
Returning change: ₹10
- GUI version using Tkinter
- Add more products dynamically
- Inventory management system
- Payment integration (UPI simulation)
- Admin mode for restocking items