Function
A reusable named block of code defined with def, taking inputs and returning a value.
- First-class objects: assignable, passable, returnable.
- No return → returns None.
- Backbone of every reusable training/eval utility.
When to use: Anywhere you want code reuse, abstraction, or unit testability.
Example: def standardize(x): return (x - x.mean()) / x.std(). list(map(standardize, columns)).