While condition program having confusion

Welcome to python discuss. You can refer to this link to learn more about formatting your code instead of displaying it as raw text and some general rules about the user category.

Basically, in the first example, the program executes the scope of the while loop while i is increasing, and when i reaches 3, we have a continue statement. This statement will instruct the program to jump to the line while(i<=10):. The most important thing here is that the program is not updating the control variable i before the continue statement. This will cause the program to jump repeatedly to the beginning of the while loop. Hence, the max value that i can achieve is 3. As a result of this, the program workflow is never coming out of the while loop, and it will ultimately get stuck forever.

The second program works as expected because it updates the value of i before the continue statement, and it only skips the value i==3.

That’s pretty much it. I hope it helps.