Skip to main content
← CoursesPython FoundationsModule 1 · Fundamentals of syntaxShopping listwrite15 / 174
+75 XP
Task
📝 **Task:** Shopping list. 📋 **Steps:** 1. Create the list: `shopping = ["milk", "bread"]` 2. Add an item: `shopping.append("eggs")` 3. Remove an item: `shopping.remove("bread")` 4. Print the list 💡 **Similar example (books):** ```python books = ["Python", "Go"] books.append("Rust") # ["Python", "Go", "Rust"] books.remove("Go") # ["Python", "Rust"] print(books) ``` ⚠️ **Hint:** `.append` and `.remove` mutate the list IN PLACE and return `None`. Don't write `x = shopping.append(...)` — `x` would be None. 🎯 **Expected output:** `['milk', 'eggs']`
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
📊 Result
Press Run to see result...

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…