Hello and welcome back. This is the fifth video of the series flow control in Python. Similar to break statement, there is also a continue statement in break the system exits the loop and then does not continue iterating the loop However, in continue the system exit the iteration only and continues the body of the loop. So, for example, there is some code that needs to be read within the iteration and it finds a continuous statement just before it within the body of the loop. It just exists that integration and then starts a new iteration. Let's see just in the form of diagram and break we saw that the test expression enters the body of loop.
Again there is a there is a condition within that condition if that condition is true, it finds within that block That there is a break and it exits the loop and if that condition is not true, it continues the trading or the body of Hummingbird and continue it just exists that iteration the remaining part of the loop. So, when it finds a continue it exists that iteration the block of code within the body of the loop that is remaining takes instead and start another iteration. Let's see this in the form of example, here it enters the body of node well is a variable it iterates over this object that is a string and within the body of the loop, it has F and it checks that the pair is I when the balance I what it does it continue and by continue that means it exits the integration.
So, with as the condition is not sure it continues to trading over the Body of loop it prints Well, the first case which is S, so, it prints s, then t then R, but when it finds it the I and l are equal there, they are competitive and they are saying it continue. So, it exists the body of it for that iteration it does not print Well in that case, so, I is not printed, continues iterating with the body of loop again, then test M and G where in these two cases, it turns out to be false So, it does not enter the body of his statement and does not find gaps in it there. So, this is how it is presented. Let's do this in the form of another example, john So, and we can use s. So, instead of asking, oh, well, these two O's should not be printed.
Let's see this. So, you see, j s are printed, when all is omitted, because in that case the if condition turns out to be true and it enters the body of a if it finds continue, it stops iteration starts the nutrition therefore, is not complete in both the cases. I hope that you have a clear understanding of concilio May you have any queries feel free to contact and let me know with your feedback. Thank you