Programming fundamentals›Repeating
Tutorial 3 of 13 · Programming fundamentals · Values and flow · BeginnerRepeating
Do something again and again without writing it out each time, and know when to stop.
6 lessons, the last is a challenge · about 1 h · Python and Java
Before you startYou finished "Making decisions": you can use values, variables, arithmetic, print, and a decision with if and else, including a chain of cases.
What you’ll be able to do
- 1Write a loop that goes through a row of values, adding up or printing as it goes, and say what each box holds after any pass.
- 2Write a counting loop that runs from one number up to another, and say which number is printed last.
- 3Write a while loop that stops when its condition fails, and spot one that would never stop.
- 4Say how many times the inner lines of two loops, one inside the other, run, and in which order the two counters change.
- 5Use break to leave a loop early and continue to skip one pass, and say which value a search stops at.
Lessons
Next in this path
Next: 4 · Functions · 6 lessons · 1 h 05 min
Give a block of steps a name, so you can use it anywhere by that name.
Playground
Try the same model with your own values. No checks, nothing recorded.
Open the playground