You can put loops inside other loops: python for i in range(3): for j in range(3): print(f"({i}, {j})") Output: (0,0), (0,1), (0,2), (1,0), (1,1), (1,2), (2,0), (2,1), (2,2) The outer loop runs 3 times.
For each outer iteration, the inner loop runs 3 times. Total: 3 × 3 = 9 iterations. Nested loops are common for 2D structures: tables, grids, matrices. The outer loop handles rows, the inner loop handles columns.