Positional argument
A positional argument is a function argument associated with a parameter according to its ordinal position in the call rather than its name.
Python How-To
A positional argument is a function argument whose value is associated with a parameter according to its position in the call.
- How it is used
- Uses positional arguments to make Python function and constructor calls concise while deciding when calls need more flexibility.
- How deep it goes
- Defines position-based matching and works through `*args` tuple packing and parameter order, without descending into interpreter internals.
- Examples
- Demonstrates tuple packing with `stringify` and three positional values in a `Task` constructor.
- What you can do after
- Apply it via Python calls and `*args` to match values by position and accept variable numbers of inputs when needed.
Django in Action
A Python positional argument is an argument assigned to a parameter according to its position in the argument list.
- How it is used
- Explains how command-line scripts receive ordered data and distinguishes positional values from optional behavior flags.
- How deep it goes
- Defines positional placement, contrasts flags, and stops short of implementing a positional Django command.
- Examples
- Uses Unix zip positions, Django musician filters, and ORM creation that requires named field values.
- What you can do after
- Apply positional arguments in command-line interfaces and choose keyword arguments when calling Django’s generic ORM create method.
The Quick Python Book, Fourth Edition
A positional parameter is a function argument identified by its ordinal position in the argument list.
- How it is used
- Uses argument order to call functions, format strings, and parse required command-line inputs.
- How deep it goes
- Explains order matching, defaults, mixed syntax, variadic capture, formatting indexes, and argparse requirements without implementation internals.
- Examples
- Demonstrates power calculations, numbered format fields, mixed function calls, and an argparse script.
- What you can do after
- Apply positional arguments to define and call functions, format strings, and configure required argparse inputs.
Read how The Quick Python Book, Fourth Edition explains positional argument →
Related concepts
- named argumentcontrasts with · A named argument is a function or command argument supplied by explicitly associating its value with a parameter name rather than relying solely on position.
- variadic argumentsused by · A variadic function or parameter accepts a variable number of arguments, often collecting the supplied values into a sequence of a specified type.
- command-line argumentkind of · A command-line argument is a value supplied to a program when it is invoked, either as positional input or as an option that configures its behavior.
- argument parserconfigured by · An argument parser is a component that defines accepted command-line arguments and converts supplied argument text into structured values.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


