There are two related concepts, both called "keyword arguments".

On the calling side, which is what other commenters have mentioned, you have the ability to specify some function arguments by name. You have to mention them after all of the arguments without names (positional arguments), and there must be default values for any parameters which were not mentioned at all.

The other concept is on the function definition side: you can define a function that takes parameters by name -- and you don't even have to specify what those names are. These are pure keyword arguments, and can't be passed positionally. The syntax is

def my_function(arg1, arg2, **kwargs)

Any keyword arguments you pass into this function will be placed into a dictionary named kwargs. You can examine the keys of this dictionary at run-time, like this:

def my_function(**kwargs):
    print str(kwargs)

my_function(a=12, b="abc")

{'a': 12, 'b': 'abc'}
Answer from Ian Clelland on Stack Overflow
🌐
Medium
medium.datadriveninvestor.com › args-and-kwargs-in-python-the-flexible-functions-every-developer-must-master-71baf64ca63e
*args and **kwargs in Python — The Flexible Functions Every Developer Must Master | by Anam Ahmed | Mar, 2026 | DataDrivenInvestor
1 week ago - *args and **kwargs in Python — The Flexible Functions Every Developer Must Master Have you ever written a Python function and then suddenly realized… “What if I don’t know how many inputs …
🌐
The Python Coding Stack
thepythoncodingstack.com › p › python-function-parameters-arguments-args-kwargs-optional-positional-keyword
"AI Coffee" Grand Opening This Monday • A Story About Parameters and Arguments in Python Functions
May 7, 2025 - Any keyword arguments must come after all the positional arguments. Once you include a keyword argument, all the remaining arguments must also be passed as keyword arguments. And this rule makes sense. Python can figure out which argument goes to which parameter if they're in order.
🌐
W3Schools
w3schools.com › python › gloss_python_function_keyword_arguments.asp
Python Keyword Arguments
Python Functions Tutorial Function Call a Function Function Arguments *args **kwargs Default Parameter Value Passing a List as an Argument Function Return Value The pass Statement i Functions Function Recursion
Top answer
1 of 10
417

There are two related concepts, both called "keyword arguments".

On the calling side, which is what other commenters have mentioned, you have the ability to specify some function arguments by name. You have to mention them after all of the arguments without names (positional arguments), and there must be default values for any parameters which were not mentioned at all.

The other concept is on the function definition side: you can define a function that takes parameters by name -- and you don't even have to specify what those names are. These are pure keyword arguments, and can't be passed positionally. The syntax is

def my_function(arg1, arg2, **kwargs)

Any keyword arguments you pass into this function will be placed into a dictionary named kwargs. You can examine the keys of this dictionary at run-time, like this:

def my_function(**kwargs):
    print str(kwargs)

my_function(a=12, b="abc")

{'a': 12, 'b': 'abc'}
2 of 10
224

There is one last language feature where the distinction is important. Consider the following function:

def foo(*positional, **keywords):
    print "Positional:", positional
    print "Keywords:", keywords

The *positional argument will store all of the positional arguments passed to foo(), with no limit to how many you can provide.

>>> foo('one', 'two', 'three')
Positional: ('one', 'two', 'three')
Keywords: {}

The **keywords argument will store any keyword arguments:

>>> foo(a='one', b='two', c='three')
Positional: ()
Keywords: {'a': 'one', 'c': 'three', 'b': 'two'}

And of course, you can use both at the same time:

>>> foo('one','two',c='three',d='four')
Positional: ('one', 'two')
Keywords: {'c': 'three', 'd': 'four'}

These features are rarely used, but occasionally they are very useful, and it's important to know which arguments are positional or keywords.

🌐
Python
peps.python.org › pep-0736
PEP 736 – Shorthand syntax for keyword arguments at invocation | peps.python.org
See the Ruby 3.1.0 release notes (search for “keyword arguments”). The syntax is easy to implement as it is simple syntactic sugar. When compared to the prefix form (see Rejected Ideas), this syntax communicates “here is a parameter, go find its argument” which is more appropriate given the semantics of named arguments. A poll of Python developers indicates that this is the most popular syntax among those proposed.
🌐
Educative
educative.io › blog › what-are-keyword-arguments-in-python
What are keyword arguments in Python?
August 18, 2025 - Keyword arguments in Python let you pass values to functions by explicitly naming the parameters, improving code readability and flexibility.
🌐
Vegardstikbakke
vegardstikbakke.com › python-keyword-only
Enforcing keyword arguments in Python 3 — Vegard Stikbakke
November 27, 2018 - A solution for this is to enforce using keyword arguments. This is possible to do in Python 2 by specifying a keyword argument dictionary, typically called **kwargs.
Find elsewhere
🌐
W3Schools
w3schools.com › python › python_arguments.asp
Python Function Arguments
The phrase Keyword Arguments is often shortened to kwargs in Python documentation.
🌐
Learning Actors
learningactors.com › home › blog › how to use variable and keyword arguments in python
How to Use Variable and Keyword Arguments in Python - Learning Actors
June 15, 2022 - Make your functions more flexible and easier to use with these variations on standard arguments. There are three types of arguments that a Python function can accept: standard, variable (*args), and keyword (**kwargs). Standard arguments are the simplest but have limited functionality.
🌐
Python documentation
docs.python.org › 3 › tutorial › controlflow.html
4. More Control Flow Tools — Python 3.14.3 documentation
In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is ...
🌐
Plain English
python.plainenglish.io › understanding-python-function-arguments-positional-keyword-default-ca71a7fa3453
Understanding Python Function Arguments — Positional, Keyword, Default | Python in Plain English
July 1, 2025 - When you pass information (a.k.a. arguments) into a function, Python doesn’t guess — it grabs things in the exact order you gave them. No switching. No assumptions.
🌐
Devcamp
bottega.devcamp.com › full-stack-development-javascript-python › guide › overview-keyword-arguments-python-functions
Overview of Keyword Arguments in Python Functions
So now if I call greeting and I pass in some named arguments so I could say first_name like this and then pass in Kristine and then I can say last_name equals Hudgens. If I run this code you can see that what gets printed out is a dictionary where the name to Key so this name parameter first name is the key and then the value is whatever I passed into it. And so this is a very basic way of working with keyword arguments.
🌐
tedious ramblings
blog.tedivm.com › guides › 2026 › 03 › beyond-the-vibes-coding-assistants-and-agents
Beyond the Vibes: A Rigorous Guide to AI Coding Assistants and Agents - tedious ramblings
March 3, 2026 - ### General * Assume the minimum version of Python is 3.10. * Prefer async libraries and functions over synchronous ones. * Always define dependencies and tool settings in `pyproject.toml`: never use `setup.py` or `setup.cfg` files. * Prefer existing dependencies over adding new ones when possible. * For complex code, always consider using third-party libraries instead of writing new code that has to be maintained. * Use keyword arguments instead of positional arguments when calling functions and methods.
🌐
DEV Community
dev.to › connor-ve › how-to-use-keyword-arguments-in-python-gcl
How to use Keyword Arguments in Python - DEV Community
May 22, 2023 - In python, keyword arguments aka kwargs give developers the power create a function that can accept a variable number of arguments. Unlike the normal set up for a function where the argument amount is strictly defined, kwargs allow one to pass ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › args-kwargs-python
*args and **kwargs in Python - GeeksforGeeks
In Python, *args and **kwargs are used to allow functions to accept an arbitrary number of arguments. These features provide great flexibility when designing functions that need to handle a varying number of inputs.
Published   September 20, 2025
🌐
Real Python
realpython.com › ref › glossary › kwargs
kwargs (keyword arguments) | Python Glossary – Real Python
In Python, **kwargs is a special syntax for defining functions that accept an undetermined number of keyword arguments.
🌐
Sarthaks eConnect
sarthaks.com › 3472236 › what-are-keyword-arguments-in-python-functions
What are keyword arguments in Python functions? - Sarthaks eConnect | Largest Online Education Community
March 25, 2023 - LIVE Course for free · In Python, keyword arguments are a way to pass arguments to a function using their names, rather than their positions. This allows you to specify the values for specific arguments without having to remember their positions ...
🌐
Medium
medium.com › @AlexanderObregon › how-python-handles-keyword-only-arguments-in-functions-97855146853b
How Python Handles Keyword-Only Arguments in Functions
January 7, 2025 - In Python, keyword-only arguments are function parameters that can only be specified using their names during a function call. They were introduced to improve code readability and prevent accidental misplacement of arguments.
🌐
GeeksforGeeks
geeksforgeeks.org › python › keyword-and-positional-argument-in-python
Keyword and Positional Argument in Python - GeeksforGeeks
September 18, 2025 - When calling a function, the way ... useful, but they behave differently. Keyword arguments mean you pass values by parameter names while calling the function....
🌐
Pydantic
docs.pydantic.dev › latest › concepts › pydantic_settings
Settings Management - Pydantic Validation
You can also use the keyword argument override to tell Pydantic not to load any file at all (even if one is set in the model_config class) by passing None as the instantiation keyword argument, e.g. settings = Settings(_env_file=None). Because python-dotenv is used to parse the file, bash-like ...