2
Logic & Loops
A program that always does the same thing is a document. Today you give your code choices and repetition — the two ideas behind every algorithm you will ever write.
Lessons
- 1 Booleans & Comparisons True, False, and the operators that produce them — the raw material of every decision your code makes. booleans comparison logic
- 2 if / elif / else Branching, indentation as syntax, and how to keep a chain of conditions readable. if control-flow indentation
- 3 while Loops Repeat while something stays true — counters, accumulators, validation loops, and how to avoid an infinite one. while loops break
- 4 for Loops & range() Walk through a sequence item by item — the loop you will write ten times more often than while. for range enumerate