Loops
New idea
Say hi 1,000 times
Imagine you must show "hi" on the screen 1,000 times. Writing 1,000 lines would be slow and boring, and one typo could ruin it. A computer never gets bored, so let it repeat.
A loop repeats some steps. In our code, for i in range(3): runs the indented lines 3 times. The box i is the counter: it starts at 0 and goes up by 1 each round, so it holds 0, then 1, then 2.
Counting from 0 is how most programming languages work. That is why range(3) gives 0, 1, 2 and not 1, 2, 3.