Computer Science Β· beginner
How Loops Work in Code
Interactive Diagram
Click on parts to learn more
See It In Action
Watch how it works β step by step
Interactive Experiment
Adjust the controls and see what happens
How It Works
Loading gameβ¦
Computer Science Β· beginner
Click on parts to learn more
Watch how it works β step by step
Adjust the controls and see what happens
Tap each piece of the loop to learn what it does.
for i from 1 to 5:
print("i = " + i)
print("Done!")
counter i
1
output
Configure a loop, then execute. Observe the iteration count, output sequence, and termination behavior.
output