Hi, welcome to this new video. We are going to start talking about iteration. And this is one of the kind of, the cornerstones of, one of the things that we can do with programming is basically repeating things over and over and not necessarily repeating them exactly the same. But rather kind of how it can repeat and learn from every iteration that we perform, right? So let's start understanding the notion of iteration. We're going to be understanding the notion of iteration as a sequence, right? So think about a sequence of instructions for the code to be repeated a specific number of times to achieve a particular result, right? As you saw in our last video, we were starting to understand primitives that have a sequence of vertices, right? So you might be thinking, well, it's kind of quite manual to type those vertices over and over and over again. What if I want to have 1000 vertices, right? So it's clear that many operations within computing between programming need to be performed automatically. Or need to be displayed in such a way that the computer would understand how to iterate or go through a large amount of data or repeat something perhaps many many times, right. So that's something that is actually quite easy to do with specific constructs that we have for that. So we're going to be introducing something called the for loop. A for loop is our first out of a few different loops that we will evaluate, but the for loop really gives us a simple way to iterate. So let's look at the syntax together. So it says four and we have a variable which is in this case num representing a number. And then we use in range, range is going to give us a series of numbers, right. We saying four, because we want a range between 0 and 3. One of the things that we actually will see within this kind of range function that we're using is that we will start at 0. 0 it's by definition especially or by convention in a way, the way we're starting an iteration process. And you can see as we run this code and we're using here an indentation in python. The indentation meaning the space that is granted below the for loop, will suggest that all the lines after the for loop that are indented belong to that for loop, right? It's a series, it's a part of the code that specifically will be repeated many times. And why do we need this variable of num? Because we want to keep track in which iteration are we in so many times we can think of it as a variable I standing for iterator, right. Because the first time we loop through this variable, the variable will start at 0, and then we will move to the second loop version of the loop, and it will be one. The third time will be two, and the final time would be three, rihgt. And at that point we will conclude the loop, because the variable is no longer within the range that we've specified and we can continue our code. So whenever you see this kind of structure, the for loop, think of it as a section of the code in which the program will repeat itself until it concludes the task established by the loop, right? So let's look at an example. We can look at something like a tuple, like we haven't really kind of described data structures yet, we're going to look that later. But if you have something like a series of words together, like hello world, you can do a loop that evaluates each one of the entities within that structure. So hello world, there are two strings separated by a comma. So if we would actually print each one of the entities within the hello world, or the words within that, you would get first the line hello and then the line world. Similarly, we could actually loop through a string, right? So strings are a collection of letters, and we could also think, well, what if we want to iterate over each one of those strings? So in this case, this example, the variable I, which again is an arbitrary name that we're giving to this variable. Will select independently the different characters that exist within the string hello, right? So as you can see, the result of such print function, you would get the h, the e, the l, the l, the o, right? So for loops are used in a variety of contexts to repeat information, to go through information and repeat some operation. We can do a large part of our code within a loop structure, right, where we do kind of complex calculations. And we will start seeing that loops, a very quick way for a computer to really start running, maybe slower and start kind of using a lot of computation, right? But that's the nature of what we can do with computing. How many things can we really evaluate at a given frame? And are we doing those sequentially or are we doing those distributedly? That's different paradigms of programming than we might take. In this case, the for loop suggests that we will actually do a repetition in a single frame, right? So within a single frame of our computation, we will perform a series of calculations. So this is the foundation of our for loop. In the next videos, we'll start seeing how to use them within processing.