nerdexam
Python_Institute

PCEP-30-02 · Question #180

A way of passing arguments in which the order of the arguments determines the initial parameter's values is referred to as:

The correct answer is A. positional. Positional arguments (option A) are named exactly for what they do: the position of each argument in a function call determines which parameter it maps to. For example, greet("Alice", 25) passes "Alice" as the first parameter and 25 as the second, purely based on their order…

Question

A way of passing arguments in which the order of the arguments determines the initial parameter's values is referred to as:

Options

  • Apositional
  • Bsequential
  • Cordered
  • Dordered

How the community answered

(43 responses)
  • A
    72% (31)
  • B
    5% (2)
  • C
    16% (7)
  • D
    7% (3)

Explanation

Positional arguments (option A) are named exactly for what they do: the position of each argument in a function call determines which parameter it maps to. For example, greet("Alice", 25) passes "Alice" as the first parameter and 25 as the second, purely based on their order.

Options B ("sequential") and C/D ("ordered") are close in meaning but are not established programming terms for this concept - they describe a general sense of ordering but lack the precise technical meaning. The field specifically uses "positional" to distinguish this approach from keyword arguments, where you name the parameter explicitly (e.g., greet(name="Alice", age=25)) so order doesn't matter.

Memory tip: Think of a position in a line - the first person maps to the first spot, the second to the second. "Positional" literally tells you where each argument lands, which is exactly how the term works in code.

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice