There are two different kind of loops in Python that you can distinguish. The first is the indefinite loop. That is the while loop, that I already explained in my previous blog. This is an indefinite loop, because it goes on till it meets the condition that is given in that loop. The other kind is the one that I am going to explain in this blog, the for loop. This is a definite loop, because you say in the condition the times that the codes needs to walk through the loop, so you fix the amount before.
Okay I am going to start with giving you one of the most easy examples:

Behind the for statement you add the times that it has to walk through the loop. You need to pay attention, because it is until the second value that you give (3), not to up to and including. So in this case you have a x with value 0, 1 and two, as you can see in the output. Underneath the for, you need to put what you want to print that times. In this case We’re on time and the value of x.
Just like you can nest the while loop, it is also possible to nest the for loop. Behind the first for you put the amount of times that it needs to walk trough the whole loop. For example:

So here it walks two times trough the whole loop with five times trough the second for and five times trough the third for.
I hope you enjoyed and understood this blog about using a for loop in Python!