A simple console-based shopping cart system using Object-Oriented Programming in Python. You can browse, add, remove, and update products with JSON-based file persistence.
- View physical and digital products
- Add, update, and remove items from cart
- View cart summary with total price
- Auto-save and load cart using JSON
- Clean beginner-friendly OOP design
- Inheritance β Product subclasses for physical/digital items
- Encapsulation β Uses private attributes
- Polymorphism β Custom
__str__()for products - Abstraction β Logic hidden in methods
- Magic Methods β
__init__,__str__, etc.
- Make sure Python 3.x is installed.
- Run the script:
python shopping_cart.py- Follow the menu in terminal.
shopping_cart.pyβ Main Python scriptcart_data.jsonβ Cart persistence (auto-generated)README.mdβ Project overview
- Practice real-world OOP in Python
- Understand file handling with JSON
- Great for DSA + Python beginners
Urbi Mangal β Made with β€οΈ in Python.