Control flow & functions
Make code decide, repeat, and be reused.
Lessons
- If / else — Conditionals let a program choose a path. Only the first matching branch runs.
- Loops — Loops repeat work. `for` walks a sequence; `range(n)` gives 0…n-1.
- Functions — A function packages code under a name and hands back a value with `return`.
- Lists & dictionaries — Lists hold ordered items; dictionaries map keys to values. Both are everywhere in data work.
- Number-guessing game — Combine variables, loops, conditionals and input into a small but complete program.
- Control flow boss — Loops and functions together, four ways. Beat it to unlock the Machine Learning galaxy.