β All terms Β· Functions
Closure
An inner function that captures variables from its enclosing scope. The captured value is by reference, not by value.
Learn this interactively:
Open lesson lesson-118 βRelated β Functions
FunctionNamed reusable block of code. Defined with `def`. First-class β you can pass funβ¦Default argumentParameter with a fallback value: `def f(x=10)`. Beware mutable defaults β `def fβ¦*args, **kwargsCapture variable positional and keyword arguments. Lets a function accept any siβ¦LambdaAn anonymous one-line function: `lambda x: x*2`. Use for short callbacks; preferβ¦DecoratorA higher-order function that wraps another to add behavior β logging, caching, aβ¦