For Loops
A for loop iterates over each item in a sequence one at a time
What it does: A for loop repeats a block of code once for each item in a sequence — a list, a string, or a range() of numbers. The loop variable (often i or x) takes each value from the sequence in turn, connected by the keyword in: for i in range(5):. Like an if statement, the line must end with a colon and the repeated code must be indented underneath it.
Common mistakes: Forgetting the trailing colon (for i in [1, 2, 3] instead of for i in [1, 2, 3]:) is the most common slip. It's also easy to forget that range(5) produces 0, 1, 2, 3, 4 — five numbers starting at 0, not 1 through 5.
Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
forFill in the Blanks
Spot the Error
Create a free class, add this module to a journey, and track who's stuck.
Create a free teacher account →No credit card. No setup fee. Make a class and invite students in under three minutes.
Practice this topic interactively, track progress, and unlock badges.
Start Learning Free →