##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Doing something once is easy. Doing it a thousand times by hand is impossible. This section teaches repetition.
The goal
Repeat while true
Loops that never stop
Interactive loops
Loop basics
Iterate over sequences
Counting loops
When to use which
Iteration basics
Descending loop
Loop practice
The accumulator pattern
The solution
summary
Loop aggregation
Exit loops early
Skip to next iteration
Exit vs skip
Loop control
While with break
Second highest value
Two approaches
The solution
summary
Removing duplicates
Loops inside loops
Nested loop example
Building shapes
Iteration counts
Nested loops
Nested loop challenge
The core idea
The solution
summary
Row relationships
Uncommon but useful
Found or not found
When else runs
Index and value together
Parallel iteration
Concise loop syntax
enumerate and zip
What we learned