 Hello, and welcome back to the videos in this lesson. We're now going to move into bootstrapping and how we can use bootstrapping to develop more samples that we can then use to develop confidence intervals because in the previous lecture, we had four samples. And while we can use that to develop confidence intervals, we really want a lot more data in order to really ensure that our results are the most statistically sound that they can be. And that's where bootstrapping comes in. But before we get into bootstrapping, I wanted to briefly introduce for loops, because that's how we actually conduct the bootstrapping is through leveraging for loops. So this video will just cover how we implement for loops in Python. So we are back in Google Colab. We've got our libraries here that we're going to use throughout the bootstrapping lectures. But in this case, we're simply going to talk about for loops. And so there are a few keywords that we need to be aware of when working with for loops. The word for starts the loop. The word in tells Python how many iterations to complete. And the colon tells Python that everything that comes after this is included in the loop. So to give a very simple example, we can say for I in range 0 to 10 colon. And so everything after this will be executed in the loop. The I here is a placeholder that is just counting up the iterations for us. So it's saying I is what is counting up from zero to nine. And again, remember that Python does that weird thing where it excludes the last number so we're really doing zero to 10 minus one. The key thing is to make sure that whatever you list in this opening statement of the loop is also considered in the body of the loop. So here we want to print I. So if we were to print J, it wouldn't work. You can see that we've got this red line underneath telling us that there is no variable J. And that's because we messed up our counter. We need to define I, which is defined up here. We can also do operations. So we can print I equal to two or I plus print I print I plus two. And then we can keep going. And as long as we maintain the same indent level will execute everything. When we're done with the loop, we can backspace. I like to write a comment to let me know that I'm done with the loop. And then we can continue on with whatever we were doing. And so if we run this, we can see that it's printing I zero and it's printing I plus two, two, but then it goes back and now it prints I now I is equal to one. I plus two. Now I is equal to two print and so forth until it ends and says this is the end of the loop. And so within these loops, once we get into bootstrapping will do a lot more intensive loops, but the basic structure will always remain the same. The next style of loop that I wanted to demonstrate was how we can nest loops. So this is where we add for loop inside of a for loop. It starts off with the same style will say zero before this time, which is actually three. And we'll say that we want to print. And then print I so here we're mixing text and a value. And then for each iteration of I, we want to also complete a series of values for J. We'll say zero to three. And then we can see that when I enter down. I'm another indent here so this is our first loop. And now this is our second loop. So we can print J equals. So we are printing with J is equal to J. In order to make sure that our loops are organized, we can go back one space and add a comment. And now if we wanted to do anything outside of the inner loop but still in the outer loop. We can add stuff there so we can say this is the end of the inner loop. And then if we backspace again comment and we can also print. So if we run this. We can see that it is it started where I equals zero, and then it gives J one through two, it iterates through all of J during the first iteration of I, and then it does our print. Increases I by one and re iterates through all of J. And so forth until we reach the end. And so the purpose of these nested loops is when you have multiple things that you're iterating over and you need to do them sort of in sequence. So we use primarily this single version of the loop throughout the bootstrapping lectures but just know that you can also do a lot of what we're doing with nested loops as well.