Challenge 2: Flatten and Filter — Possible Solution ==================================================================== matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] evens = [n for row in matrix for n in row if n % 2 == 0] print(evens) Output: [2, 4, 6, 8] WHY THIS WORKS AS AN ANSWER ------------------------------ for row in matrix for n in row reuses this chapter's own nested comprehension shape exactly — for row in matrix is the outer loop, for n in row is the inner one, read left to right in the same order they'd appear as nested for loops, matching the chapter's own flattening example and its loop-equivalent breakdown. Adding if n % 2 == 0 at the end filters each individual number as it's produced — n % 2 == 0 reuses the exact even-number modulo check from Course 1, Chapter 4. Because the if comes after both for clauses, it applies to n (the innermost, fully-flattened value), not to row — this is what makes the filtering happen on individual numbers rather than on whole rows. Written as nested loops, this would be: evens = [] for row in matrix: for n in row: if n % 2 == 0: evens.append(n) which produces the same flattened-then-filtered result: only 2, 4, 6, and 8 pass the even check out of all nine numbers in the matrix.