All problems
EasyLists
List comprehension — filter evens
From 1..20, build a list of the even numbers using a comprehension with `if`.
- #comprehension
- #filter
Sample input
1..20
Sample output
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
list-comp-filter.py
Output
Press "Run code" to execute.
