Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

nested loop

//nested for
for (expr1; expr2; expr3) {
    for (expr1; expr2; expr3) {
        //statement;
    }
}

// EXAMPLE
for ($i = 1; $i < 5; $i++) {
    for ($j = 1; $j <= $i; $j++) {
        echo " * ";
    }
    echo '<br />';
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nested #loop
ADD COMMENT
Topic
Name
4+3 =