Loops in Python
Loops in Python: Repeating with while, Counting with for and range.
Updated
- Repeating with while (Novice): A while loop runs its indented block again and again as long as its condition stays True, so a program can count, keep going until a job is done, or keep asking until an answer makes sense.
- Counting with for and range (Novice): A for loop runs its block once for each item it's handed, range() hands it a row of numbers to count with, up, down or in steps, and break and continue end a loop early or skip one pass.