keyword argument
An argument passed by naming the parameter it is for, as in print(x, end=""), instead of by position.
In more detail
Keyword arguments come after any positional ones and can be in any order. They make calls clearer and let you skip optional parameters. A dictionary can supply many at once with **, as in format(**d).
Related terms
- positional argument — An argument matched to a parameter by its position in the call: first to first, second to second.
- argument — A value you pass to a function when you call it, written inside the parentheses of the call.
- dictionary unpacking — Writing ** before a dictionary in a function call to pass each of its key-value pairs as a keyword argument.
- sep — The keyword parameter of print that sets the text placed between its arguments; by default a single space.
Taught in
- Input, And Numbers Versus Digits — Hands-on Python: Complete Video Course & Book
- Multiple Parameters — Hands-on Python: Complete Video Course & Book
- Dictionaries And String Formatting — Hands-on Python: Complete Video Course & Book
- The Print Function Keyword End — Hands-on Python: Complete Video Course & Book
- Print, Input And The Casts Between — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Parameters, Arguments And Scope — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep