β‘Higher-Order Functions
Travelling First-Class.
Python treats functions like "first-class citizens". This means that the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures.
Higher-order functions are functions that accept a function as an argument and/or return a function as a value. For example,
Here, f
would be a higher-order function βΒ since it returns another function g
.
Last updated