Positional parameter
A positional parameter is a command or function parameter whose value or meaning is determined by its position among supplied arguments rather than an explicit name.
Tiny Python Projects: Learn coding and testing with puzzles and games
A command-line parameter whose meaning is determined by its position in the argument sequence rather than by an option name.
- How it is used
- Uses positional parameters to define required command-line input for small Python programs and exercises.
- How deep it goes
- Explains naming, ordering, requiredness, nargs='+' and nargs='*', lists, help output, and validation, without descending into argparse internals.
- Examples
- Demonstrates word, text, letter, item, and file arguments through greeting, picnic, lookup, file-reading, and string-replacement programs.
- What you can do after
- Build command-line interfaces that parse, validate, document, and consume one or more positional values.
Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
A positional parameter is a command or script parameter whose value can be supplied by its position without naming the parameter explicitly.
- How it is used
- Speeds up frequently used PowerShell commands by allowing values without repeatedly typing parameter names.
- How deep it goes
- Explains syntax markers, position numbers, ordering rules, mixed usage, and readability tradeoffs without covering parameter binding internals.
- Examples
- Demonstrates Get-Item, Get-ChildItem, Get-Help, and Get-DiskInventory.ps1 with positional and named forms.
- What you can do after
- Apply it via PowerShell by reading help syntax, supplying positional values correctly, and choosing named parameters for durable scripts.
The Well-Grounded Python Developer: How the pros use Python and Flask
A positional parameter is a function parameter whose value is assigned according to its position among the supplied arguments.
- How it is used
- Defines input order as part of a Python function’s API contract.
- How deep it goes
- Works through definition and call order, named calls, and missing required values without descending into function internals.
- Examples
- Uses full_name calls with ordered or named arguments and print calls with multiple objects.
- What you can do after
- Build it from scratch by defining required function inputs in a clear order and calling them accordingly.
Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools
Positional parameter binding assigns arguments to command parameters according to their declared positions.
- How it is used
- Explains how PowerShell supplies command input during invocation and pipeline execution.
- How deep it goes
- Defines positional binding, explains its precedence in binding order, and traces execution without detailing parameter implementation internals.
- Examples
- Uses Get-Service, Where-Object, ConvertTo-HTML, and Trace-Command examples to expose and trace implicit binding.
- What you can do after
- Diagnose command behavior by expanding omitted parameter names and tracing ParameterBinding activity.
Go in Practice, Second Edition
A positional argument is a command-line value interpreted according to its position rather than an option name.
- How it is used
- Uses argument position to supply command-specific values in Cobra command-line applications.
- How deep it goes
- Defines extraction and demonstrates two operands, but does not detail validation or argument-count handling.
- Examples
- Demonstrates first-argument extraction and an add command receiving number1 and number2 as positional operands.
- What you can do after
- Apply positional arguments by extracting values from Cobra's command argument slice and passing them to application logic.
Read how Go in Practice, Second Edition explains positional parameter →
Also covered in
What to know first
- command-line argumentA command-line argument is a value or option supplied to a program when it is invoked, providing input or affecting its behavior.
- exit codeAn exit code is a numeric status returned by a process when it terminates to indicate the outcome of its execution.
- inputAn input is information, a value, or an action supplied to a system, program, or computation for processing or to influence its behavior.
- help messageA help message is command-line documentation that explains a program’s invocation syntax, arguments, options, and usage.
Related concepts
- filteringincludes · Filtering is the selection or exclusion of data or items according to specified criteria.
- file pathincludes · A file path is a textual or structured identifier specifying the location of a file or directory in a filesystem.
- command-line argumentkind of · A command-line argument is a value or option supplied to a program when it is invoked, providing input or affecting its behavior.
- inputkind of · An input is information, a value, or an action supplied to a system, program, or computation for processing or to influence its behavior.
- keyword parametercontrasts with · A keyword parameter is a function parameter whose value is supplied by naming the parameter and which may have a default value.
Questions about positional parameter
What is positional parameter?
A positional parameter is a command or function parameter whose value or meaning is determined by its position among supplied arguments rather than an explicit name.
Which Manning books explain positional parameter?
Tiny Python Projects: Learn coding and testing with puzzles and games, Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS, The Well-Grounded Python Developer: How the pros use Python and Flask, Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools and Go in Practice, Second Edition.
What should I know before learning positional parameter?
Manning books that teach positional parameter usually introduce command-line argument, exit code, input and help message first.
What is the difference between positional parameter and keyword parameter?
A positional parameter is a command or function parameter whose value or meaning is determined by its position among supplied arguments rather than an explicit name. A keyword parameter is a function parameter whose value is supplied by naming the parameter and which may have a default value.
What kinds of positional parameter are there?
Kinds of positional parameter include filtering and file path.
What is positional parameter a kind of?
Positional parameter is a kind of command-line argument. A command-line argument is a value or option supplied to a program when it is invoked, providing input or affecting its behavior.
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.




