Higher-Order Function
Domain: Programming Fundamentals
π― Motivation
Functions that take other functions as arguments (or return them) let you write very flexible, reusable code.
π Concrete Example
map(str.upper, ['a','b']) applies str.upper to each element. filter(lambda x: x > 0, [-1, 0, 1]) keeps only positives.
π Analogy
A manager who assigns tasks to workers - the manager (higher-order function) doesnβt do the work; it decides which worker (function) does what.