0
Explain of a challenge
can anyone explain the code? https://code.sololearn.com/Wgh4JHgO6IlG/?ref=app
6 Answers
+ 1
The loop will run 9 times. why? because the second loop is j less or equals 3, so the first loop runs 3 times (0, 1, 2) and the second loop runs 3 times as well (0, 1, 2), so you end with 3*3 = 9
0
Shadman Sakib , you have two loops, one nested in another. The nested loop runs three times (0, 1 and 2 => 3 steps). After the completion the outer loop is running 1 time. So you have for each step in outer loop the inner one runs 3 times => 3 * 3 = 9.
0
yeah. but why 9?
0
thank I understand