Fundamentals15 / 30
Up next

List comprehension

# square the even numbers 0..9
squares = [n * n for n in range(10) if n % 2 == 0]
print(squares)
What you're solving

build a list in one expression