You’ll filter values from a list based on a condition.
Estimated time: 10 minutes | Difficulty: Beginner
Problem
Return only the even numbers from a list.
Inputs
- numbers:
list[int]
Output
A list of even integers.
Example
Input

Output

Constraints
- Input may be empty
- The list may contain negative numbers
- Zero (
0) is considered even - Do not modify the original list
Requirements
- Function name:
filter_even - Parameter:
numbers(list of integers) - Return type:
list[int]
Starter Code

Edge Cases to Consider
- Empty list
- List with no even numbers
- List containing zero
- List containing negative numbers

Explanation
- Iterate through the list and select numbers divisible by 2
- Time complexity: O(n)
- Space complexity: O(n)

Nice work!
You’ve completed this challenge. The best way to improve your Python skills is to keep practicing while the concept is fresh.
What you’ve accomplished
By finishing Challenges 1–5, you’ve practiced:
- Strings
- Lists
- Dictionaries
- Conditions
- Real validation with tests
This is a strong foundation.
🔗 View reference solution on GitHub
(After you’ve tried the challenge)
👉 Next Challenge → Even or Odd (With Input Validation)
Want more practical Python challenges?
Subscribe to the Solve With Python newsletter and get new problems delivered to your inbox.