Skip to main content

← All terms · Functions

*args, **kwargs

Capture variable positional and keyword arguments. Lets a function accept any signature.

Learn this interactively:

Open lesson lesson-65

Related — Functions

FunctionNamed reusable block of code. Defined with `def`. First-class — you can pass funDefault argumentParameter with a fallback value: `def f(x=10)`. Beware mutable defaults — `def fLambdaAn anonymous one-line function: `lambda x: x*2`. Use for short callbacks; preferDecoratorA higher-order function that wraps another to add behavior — logging, caching, aClosureAn inner function that captures variables from its enclosing scope. The capturedfunctools.partialPre-bind some arguments of a function — produces a new callable with fewer param