Repetition

A popular children’s song has repetition
The bell on the bus goes
Ding, ding, ding
Ding, ding, ding
Ding, ding, ding
The bell on the bus goes
Ding, ding, ding,
all day long.
This can be written using a loop (x3)
The bell on the bus goes
Ding, ding, ding (x3)
The bell on the bus goes
Ding, ding, ding (x1)
all day long.
The words are written once alongside the number of repeats needed
If you would like to sing along to the song maybe you would like this

control structure: loop

We already know that iteration means that a loop will make a block of code repeat.
The diagram below introduces the idea that the projects in this section will explore in much more detail
2020-12-15_22-29-35.png

loop 5 times
get a name
display the name
end loop

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.