Exercise 9: A Grid Without the Diagonal — Possible Solution ==================================================================== for row in range(4): for col in range(4): if row == col: continue print(f"({row},{col})", end=" ") print() Example run: (0,1) (0,2) (0,3) (1,0) (1,2) (1,3) (2,0) (2,1) (2,3) (3,0) (3,1) (3,2) WHY THIS WORKS AS AN ANSWER ------------------------------ The continue belongs to the inner (col) loop, so for a diagonal cell only that one pass is skipped and the inner loop carries on with the next column. The outer loop is untouched: the bare print() after the inner loop still runs for every row, which is what ends each output line. If you put the print() inside the inner loop after the continue, it would not run for the skipped cells either. Each row prints three cells because one of its four cells is always on the diagonal.