Language Syntax

Call — Python syntax

Evaluate the callable and arguments, then bind arguments according to the callable's contract. Starred iterables expand positionally; double-star mappings supply string keyword names. Duplicate bindings raise TypeError.

Formal Syntax & Structure

python syntaxpython
callable_expression(positional, *iterable, keyword=value, **mapping)

Parameters & Attributes

NameTypeDescription
callable_expressionexpressionObject to invoke.
positionalexpressionPositional argument(s), if accepted.
iterableexpressionOptional starred positional expansion.
mappingexpressionOptional double-star keyword expansion.

Return Value

object

Value obtained by evaluating this expression; see description for context and constraints.

Working Example

Example Snippetpython
def total(a,b,*,scale=1):    return (a+b)*scaleprint(total(*[2,3],**{'scale':4}))
Python Reference