🔁 Loop
3rd Grade 💻 Coding
A loop is an instruction that tells the computer to repeat a group of instructions several times — a set number of times, as long as a condition is true, or forever.
Instead of writing “move forward” ten times, you write once: “repeat 10 times: move forward.” The code is shorter, clearer and easier to change. Each time through the loop is sometimes called an “iteration.”
There are two main kinds: a loop with a known number of repeats (for in Python, “repeat X times” in Scratch), and a loop that repeats as long as a condition is true (while in Python, “repeat until …” in Scratch). Scratch also has “forever,” which is used in games that keep checking what’s happening.
For example
- Drawing a square: “Repeat 4 times: move 100 steps, turn 90 degrees.”
- A song with a chorus that keeps coming back is like a loop — the same part again and again.
- A teacher grading tests goes through the stack one by one and does the same thing with each test — that’s a loop from real life.
📌 Remember: Loop = “one more time!” without writing it again.
Quick quiz
What does a loop do?
How do you draw a square with a loop?
What is each time through a loop called?