Python · Exercise 1 of 6Next
Beginner
Edit a shopping cart
The list cart starts as ["milk", "eggs", "bread"].
Change it with list methods so that it ends as ["tea", "milk", "bread", "rice"]: add "rice" at the end, remove "eggs", and put "tea" at the very start.
Then print the number of items in the form Items: 4.
What Check tests
cartends as["tea", "milk", "bread", "rice"]"eggs"is gone"tea"is the first item- The program prints
Items: 4
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.