Daily Python
Day 13Python~35 min
List comprehensions
Compact loops for transforms and filters
Track progress0/15 days
What you'll learn
list comprehensionconditional expressionzip
- Build lists in one line with comprehensions
- Assign letter grades from scores
Lesson & examples
Read the code, then the explanation — try changing values before the project.
Filter evens
numbers = [1, 2, 3, 4, 5, 6]
evens = [x for x in numbers if x % 2 == 0]