0
how does this program work??? doesn't the break command break the loop prematurely, if that's the case there should be only 0 displayed as output followed by the print statement.
loops and break statement
2 Réponses
+ 1
In the example >= means "greater than or equal to", in this case: 5. The if statement will run 5 times, failing each time until i==6, when the condition is True and break executes.
Technically the increment is 1 so the test could be ==. Specifying >= covers the larger case in a safer way.
0
python does not have a complire