Drop links or images here to add them to the editor.

Een geneste for-loop is een for-loop die zich binnen een andere for-loop bevindt.

for x_coordinaat in range(2):
    for y_coordinaat in range(3):
        print("(", x_coordinaat, ",", y_coordinaat, ")", end=" ")

Uitvoer:

( 0 , 0 ) ( 0 , 1 ) ( 0 , 2 ) ( 1 , 0 ) ( 1 , 1 ) ( 1 , 2 )

Hoe werkt dit?