Concept Flow - Nested list comprehension
Start outer loop
Take one item from outer iterable
Start inner loop
Take one item from inner iterable
Apply expression using outer and inner items
Add result to inner list
Inner loop ends?
No→Repeat inner loop
Yes
Add inner list to outer list
Outer loop ends?
No→Repeat outer loop
Yes
Return full nested list
Nested list comprehension runs an inner loop inside an outer loop, building a list of lists by applying an expression to each pair of outer and inner items.