Welcome to this Hacendado challenge where you will be implementing an amazing grocery e-commerce shopping cart using the Python programming language!
We've prepared a catalog (pun intended) of tests to guide you through this implementation.
The main objective is to implement a Cart class that is initialized with a catalog dictionary (that contains the list of available products and their price). This Cart object must have an add, remove and total_price methods that allow us to interact with it. Futhermore, those actions raise several excepcions in some cases, more info about this in the tests.
You'll pass the challenge by implementing a Cart
class that makes the tests pass. Tests can be run by typing:
python tests.py
Good Luck and Have Fun fellow Hacendacoders!