PCEP-30-02 · Question #350
Which of the following are the names of Python passing argument styles? (Choose two.)
The correct answer is B. positional. Positional (B) and keyword (D) are the two Python argument passing styles. Positional arguments are passed in order and matched by their position in the function signature (e.g., func(1, 2)), while keyword arguments are passed by explicitly naming the parameter (e.g., func(x=1…
Question
Options
- Aindicative
- Bpositional
- Creference
- Dkeyword
How the community answered
(29 responses)- A7% (2)
- B76% (22)
- C3% (1)
- D14% (4)
Explanation
Positional (B) and keyword (D) are the two Python argument passing styles. Positional arguments are passed in order and matched by their position in the function signature (e.g., func(1, 2)), while keyword arguments are passed by explicitly naming the parameter (e.g., func(x=1, y=2)), allowing any order.
Why the distractors are wrong:
- A. Indicative - not a Python concept at all; "indicative" is a grammatical mood, not an argument style.
- C. Reference - while Python passes objects by reference internally, "reference" is not the name of a Python argument style; it describes the underlying memory mechanism.
Memory tip: Think P-K - Positional (order matters, like a numbered list) and Keyword (name matters, like a labeled box). Both appear directly in Python's own documentation and error messages (e.g., "takes 2 positional arguments"), making them the canonical terms to remember.
Community Discussion
No community discussion yet for this question.