The Block Editor *for* loop is different than the Touch Develop *for* loop in an important way. The above for loop will iterate *five* times, with the loop variable *i* taking on values 0, 1, 2, 3, and 4. The Touch Develop for loop shown below will iterate four times:
```
for (let k = 0; k <4;k++){
}
```
### Touch Develop
### ~hide
```
let upper = 5
```
### ~
```
for (let k1 = 0; k1 <upper;k1++){
// Add code to repeat here, also called the `loop body`
}
```
where
*`0` is initial value of the loop index variable `k`
* the value of `k` increases by 1 after each execution of the `loop body`
*`upper` is the number of times the loop body will repeat
In other words, the index variable (`k`) starts at 0 and increases by 1 each time the `loop body` executes, until `k = upper`.
### Example: count to 5
The following example displays numbers 1 through 5 on the LED screen:
The [LED screen](/device/screen) has a fixed number of rows and columns (5x5), which is ideal for a for loop. This example uses a for loop to turn on the LEDs along the edge of the screen, making a square.