Beginner
Fix the shared list
The class below shares one list between all carts. Fix Cart so every cart has its own items list.
add(item) appends an item and count() returns how many items the cart holds.
What Check tests
- A new cart is empty
addincreases the count- Two carts do not share items
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
main.py
Sign in to run your code.
Output
Press Run to see what your program prints.