Lesson 31 of 79 · 15 minutes
for loops and range(): Fence Builder
Each pass of the loop hammers in another post. Tell it how many, and watch the fence grow.
This game is part of the full course.You own the full course.
Unlock all 79 Python coding games for $9, once.Opening the game…
Unlock for $9Play now
What you'll learn
- Repeating a set number of times
- for or while?
- The loop variable
- Counting from 1
- Off by one
Each idea opens with a short narrated video, about 2 minutes in all. Then you put it to work in the game.
The six levels
- A Longer Fence Change it
- Eight Posts Copy and type
- Number the Posts Fill the gap
- Start From 1 Write it
- One Post Short Fix it
- Any Length Boss level
The levels go from changing one word, to writing the code on your own. The boss level changes every time you play.
New to Python? Start with the free games in Module 1.