Python · Stage 4 – Repeating Things · Lesson 23 of 50

What Is a Loop?

Understand why programs repeat instructions and what controls repetition.

Without a loop, displaying the same word three times requires three copied instructions:

print("Hello")
print("Hello")
print("Hello")
Line-by-line explanation
  1. Each line displays the same word once.
  2. The instruction is copied three times.
  3. A loop will express this repetition more clearly.