Skip to main content
← CoursesPython FoundationsModule 4 · Object-oriented programmingFilter: only couplesscenario59 / 170
💬 Discuss🧪 Playground+100 XP
Task
📝 **Task:** From `numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]` keep only evens via list comprehension. 📋 Use `[n for n in numbers if n % 2 == 0]`. 💡 **Similar example (filter odds):** ```python nums = [10, 11, 12, 13, 14, 15] odds = [n for n in nums if n % 2 == 1] print(odds) # [11, 13, 15] ``` 🎯 **Expected output:** `[2, 4, 6, 8, 10]`

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…