Welcome back to Introduction to Python scripting. This is the first course in the Python scripting for DevOps specialization. In this module we're going to think about iteration; what we mean by this is we're going to learn ways that we can change the flow of our program's execution to actually repeat code many times. By the end of this module, I want you to be able to do several things. I want you to be able to develop programs that utilize for loops. I also want you to build and develop programs that utilize while loops. And lastly, I'd like you to be able to develop programs that utilize the exit and continue statements to modify when the loop starts and ends. In this first lesson we're gonna look at the for statement. The syntax for the for loop looks like this: for variable in some collection, a collection is more than one or more item, we follow it with a colon, just like we saw with the if statement we have a colon at the end of our test, and then we indent the statements we want to do in iteration. You can have as many statements as you want, one or more, they're all indented the same level in Python. This is a little different than a lot of other languages. A lot of other languages have the idea that we're going to loop from some sort of counter to some value. But that is solved in Python with arrange statement; the range will create a collection and all you need is the stop command, but you can tell it the start command and the stop command. The Start is the starting sequence number; if you leave it off, it starts with one. Stop generates numbers up to but not including this number, you need to make that clear in your head, it doesn't include stop it in, so it's less than stop. And step is how it increases the value from the starting value up to a stop. By default, step is going to be one so if you don't include step, it'll be one. I'll show you some examples that do different versions of step. Here's an example of a for loop that adds the number 0 through five. Remember, when, when I say range six, that's going to be the numbers 1,2,3,4,5, and I'm just going to sum them up. So the sum plus equals, if you remember back to our assignments, says "take whatever's in some and add the value of x". Here's a loop that's going to add odd numbers from one through nine. So it's 1,3,5,7,9. But you see, I put these in brackets, separated by commas and that's a collection. So x is first going to be the value one, then it's going to be the value three, then it's gonna be the value five and the value seven and the value nine. And our indentation is just that summation where we're aggregating up the value of sum. And here's an alternative for loop that adds odd numbers from one through nine. We're going to initialize our value to Alright, so a little review here. A for loop goes through a collection of data one element at a time. The range function will return a collection of values and you can have as many statements as you like in a for loop. Alright, I'll see you in the next lesson.