Skip to main content
← CoursesPython FoundationsModule 1 · Fundamentals of syntaxShopping listwrite15 / 170
💬 Discuss🧪 Playground+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']`

Keep going

✏️ Write your code here
🐍
Loading Python...
First visit only — ~5-10s. Stays cached afterward.
📊 Result
Press Run to see result...
📣 Help someone learn PythonShare this lesson with a friend — the first 15 are free, no signup.Tweet

💬 Discussion

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