Search
Contents
7.
Repeating Things With Loops
7.
Repeating Things With Loops
¶
7.1. Iteration
7.1.1. Don’t Repeat Yourself
7.2.
for
Loops
7.2.1.
for
Loop Syntax
7.2.1.1. Line By Line
7.2.1.2. Begin Counting at 0
7.2.2. Check Your Understanding
7.3. More on
range
7.3.1. Set Start and Stop Values
7.3.2. Set a Step Value
7.3.3. Try It!
7.3.4. Use Variables in
range
7.3.5. Use Expressions in
range
7.3.6. Check Your Understanding
7.4. Loops With Conditions
7.4.1. Repeating a Check
7.4.2. Looping
if
7.5. The Accumulator Pattern
7.5.1. Keeping a Running Total
7.5.1.1. Adding
1...num
7.5.2. Decreasing Total
7.5.3. Check Your Understanding
7.6.
while
Loops
7.6.1.
while
Loop Syntax
7.6.2. Control Flow
7.6.3.
for
Loops Rewritten as
while
Loops
7.6.3.1. Try It!
7.6.4. Input Validation
7.6.5. Which Loop To Use?
7.6.5.1.
for
Pros and Cons
7.6.5.2.
while
Pros and Cons
7.6.6. Check Your Understanding
7.7. Infinite Loops
7.7.1. Coding Infinity
7.7.2. Check Your Understanding
7.8. Ending a Loop With
break
7.9. Exercises: Loops
7.9.1.
for
Practice
7.9.2.
while
Practice
7.9.3. Submitting Your Work
7.10. Studio: Goal Setting and Getting into the Right Mindset
7.10.1. Activity
7.10.2. Resources
7.10.3. Submitting Your Work
←
6.10.
Exercises: Booleans and Conditionals
7.1.
Iteration
→