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
| Name | Type | Description |
|---|---|---|
| callable_expression | expression | Object to invoke. |
| positional | expression | Positional argument(s), if accepted. |
| iterable | expression | Optional starred positional expansion. |
| mapping | expression | Optional 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}))