A comprehension builds a collection from an iterable. The expression says what each output contains, and an optional condition says which inputs qualify. A nested comprehension follows the same loop order as nested for statements, which matters when you flatten a grid. Dictionary comprehensions replace repeated keys; list comprehensions keep repeated items. Keep these operations readable. If a transformation needs several updates or exception handling, a normal loop can express it more clearly. You'll filter sensor values, produce lookup maps, flatten service groups, and expand scheduled checks. Every exercise states its ordering rule so you can test that your comprehension follows the same sequence.