What Is a Loop?
A loop tells a computer to do something again and again. Instead of writing "hop" five times, you say: repeat 5 times: hop.
Why Loops Save Time
Imagine drawing 100 circles without a loop vs. with a loop. Without: 100 lines of code. With a loop: just 3 lines! Loops make programs shorter and easier to write.
⭐
Real-life loop!
Clapping 10 times is a loop: repeat 10 times: clap! Your heartbeat is a loop — it keeps going and going!
Loop Count
You can control how many times a loop runs. "Repeat 3 times" runs 3 times. Knowing when to stop is important — some loops run forever!