Hello, in this video we are going to look at a new control standard so far, just a nice simple loop here. Let me just create a variable first of all they will do for in VA one, nothing new here. And then if for example, I do print, and I simply point to the character like so he'll run and each character will be printed individually. Maybe you won't want to prematurely exit at the loop. If a particular let's say character met some sort of condition is met, we can do that. So depending on where you want it, you pregame afterwards that's, you know on it's totally up to you.
Were going to put this character If that is equal to, let's say the character of space, a space character, we want to get rid of it or do break, like so. And that's great. And I'm going to play a point to tell you that what's happened. There was a new one that we got a problem mindset mindset. Got about the colon. It will run any moment.
So hello, there was a space Oh no. So broken after this statement. I can do this in a for loop as well. Same thing I'm looking at, go through that you can do that as an extra task. What else We printed this exact same thing again. But in this case, if it's a space, we're just we just want to skip over it this morning, not do the rest of the code in the loop for that particular iteration.
So every character in this loop is a iteration that every time we pass in that coordinator ration, so if there was a space between ration and instead of break, you just put the keyword continued. It's literally that simple. So now, if we run it Okay, so there we go. There was a special note for Hello. There was a sniff dip the Scituate know exactly the script iteration not printed. The space, but it still has done the rest of the iteration unless they were moved spaces.
So again, you can do sort of continued control statement within a while loop as well. So recommend doing that task. So the final one I want to cover is a path path statement. basically use when a statement is required. syntactically, we do not want any command or code to execute. The past statement is a well and no operation.
Nothing actually happens when it executes. The past is also useful in places where your code will eventually go by has not been written yet. So if I put first copy and paste this again, so we save some time, and then here is the character the same color space. Instead, we're never going to put you can do this. That's the key word. Then this over, over.
Now if we want to see what we get there, hello, hello, we'll find one says hello, passing this particular part over. So it still ran the rest of the code. The only difference was it's essentially almost like an indicator to us that, you know, we're just passing here, we might need to come back and do something later though is is a great way of indicating to us that you know, some sort of note almost. So thanks for watching, and I look forward to seeing you in the next awesome Python video.