What's the best way to handle a repetitive task? You could list out every single step one by one. Here, to make three deliveries, we need to drive forward and drop off a package. Then drive forward and deliver a package two more times. This program works, but as tasks get bigger, this method gets tedious. A better way to repeat a pattern is to use a loop. A loop is a simple instruction that tells a program to repeat a set of actions multiple times. Now, with five deliveries to make, we don't have to write 10 separate lines of code. We can just tell our program to repeat the drive and deliver sequence five times. It's cleaner, faster to write, and much easier to manage. Here, the pattern begins with driving forward and delivering a package. Next, we need to move forward one more step. Then we can begin the pattern again to complete the three deliveries.
Here's a more complex route to deliver packages around a square route. The repeating sequence is to drive forward, deliver a package, and then turn right.
By placing all three of those actions inside a loop that runs three times, we can navigate three sides of this square efficiently. This way of thinking directly translates to real programming.
What we've been calling a repeat block is known as a for loop in languages like Python. However, learning the thought process behind programming will help you write code in any language.