← Back to the lesson: List Comprehensions
Filter Even Numbers
The exercise
Create a list of even numbers from 1 to 10.
Use list comprehension with if condition.
Result: [2, 4, 6, 8, 10]
Print the list.
Starter code
# Create list of even numbers / Создайте список чётных чисел
even =
# Print / Выведите
Write the code in the browser and run it — no installation needed.