See Function Definitions in the Language Reference.

If the form *identifier is present, it is initialized to a tuple receiving any excess positional parameters, defaulting to the empty tuple. If the form **identifier is present, it is initialized to a new dictionary receiving any excess keyword arguments, defaulting to a new empty dictionary.

Also, see Function Calls.

Assuming that one knows what positional and keyword arguments are, here are some examples:

Example 1:

# Excess keyword argument (python 3) example:
def foo(a, b, c, **args):
    print("a = %s" % (a,))
    print("b = %s" % (b,))
    print("c = %s" % (c,))
    print(args)
    
foo(a="testa", d="excess", c="testc", b="testb", k="another_excess")

As you can see in the above example, we only have parameters a, b, c in the signature of the foo function. Since d and k are not present, they are put into the args dictionary. The output of the program is:

a = testa
b = testb
c = testc
{'k': 'another_excess', 'd': 'excess'}

Example 2:

# Excess positional argument (python 3) example:
def foo(a, b, c, *args):
    print("a = %s" % (a,))
    print("b = %s" % (b,))
    print("c = %s" % (c,))
    print(args)
        
foo("testa", "testb", "testc", "excess", "another_excess")

Here, since we're testing positional arguments, the excess ones have to be on the end, and *args packs them into a tuple, so the output of this program is:

a = testa
b = testb
c = testc
('excess', 'another_excess')

You can also unpack a dictionary or a tuple into arguments of a function:

def foo(a,b,c,**args):
    print("a=%s" % (a,))
    print("b=%s" % (b,))
    print("c=%s" % (c,))
    print("args=%s" % (args,))

argdict = dict(a="testa", b="testb", c="testc", excessarg="string")
foo(**argdict)

Prints:

a=testa
b=testb
c=testc
args={'excessarg': 'string'}

And

def foo(a,b,c,*args):
    print("a=%s" % (a,))
    print("b=%s" % (b,))
    print("c=%s" % (c,))
    print("args=%s" % (args,))

argtuple = ("testa","testb","testc","excess")
foo(*argtuple)

Prints:

a=testa
b=testb
c=testc
args=('excess',)
Answer from S.Lott on Stack Overflow
Top answer
1 of 5
386

See Function Definitions in the Language Reference.

If the form *identifier is present, it is initialized to a tuple receiving any excess positional parameters, defaulting to the empty tuple. If the form **identifier is present, it is initialized to a new dictionary receiving any excess keyword arguments, defaulting to a new empty dictionary.

Also, see Function Calls.

Assuming that one knows what positional and keyword arguments are, here are some examples:

Example 1:

# Excess keyword argument (python 3) example:
def foo(a, b, c, **args):
    print("a = %s" % (a,))
    print("b = %s" % (b,))
    print("c = %s" % (c,))
    print(args)
    
foo(a="testa", d="excess", c="testc", b="testb", k="another_excess")

As you can see in the above example, we only have parameters a, b, c in the signature of the foo function. Since d and k are not present, they are put into the args dictionary. The output of the program is:

a = testa
b = testb
c = testc
{'k': 'another_excess', 'd': 'excess'}

Example 2:

# Excess positional argument (python 3) example:
def foo(a, b, c, *args):
    print("a = %s" % (a,))
    print("b = %s" % (b,))
    print("c = %s" % (c,))
    print(args)
        
foo("testa", "testb", "testc", "excess", "another_excess")

Here, since we're testing positional arguments, the excess ones have to be on the end, and *args packs them into a tuple, so the output of this program is:

a = testa
b = testb
c = testc
('excess', 'another_excess')

You can also unpack a dictionary or a tuple into arguments of a function:

def foo(a,b,c,**args):
    print("a=%s" % (a,))
    print("b=%s" % (b,))
    print("c=%s" % (c,))
    print("args=%s" % (args,))

argdict = dict(a="testa", b="testb", c="testc", excessarg="string")
foo(**argdict)

Prints:

a=testa
b=testb
c=testc
args={'excessarg': 'string'}

And

def foo(a,b,c,*args):
    print("a=%s" % (a,))
    print("b=%s" % (b,))
    print("c=%s" % (c,))
    print("args=%s" % (args,))

argtuple = ("testa","testb","testc","excess")
foo(*argtuple)

Prints:

a=testa
b=testb
c=testc
args=('excess',)
2 of 5
210

I only have one thing to add that wasn't clear from the other answers (for completeness's sake).

You may also use the stars when calling the function. For example, say you have code like this:

>>> def foo(*args):
...     print(args)
...
>>> l = [1,2,3,4,5]

You can pass the list l into foo like so...

>>> foo(*l)
(1, 2, 3, 4, 5)

You can do the same for dictionaries...

>>> def foo(**argd):
...     print(argd)
...
>>> d = {'a' : 'b', 'c' : 'd'}
>>> foo(**d)
{'a': 'b', 'c': 'd'}
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-star-or-asterisk-operator
Python - Star or Asterisk operator ( * ) - GeeksforGeeks
April 25, 2025 - The asterisk (*) operator in Python is a versatile tool used in various contexts.
Discussions

All you need to know about Asterisks in Python
Unpacking syntax is missed, like a = [1, 2, 3] head, *b = a Edit: the article has been updated and now includes this example! More on reddit.com
🌐 r/Python
65
371
May 25, 2022
What is the significance of a single, lone asterisk in a functions documentation?
Hello all, I keep coming across this and my Google Fu (actually DuckDuckGo Judo) cannot find the answer; what is the significance of a single, lone asterisk in the local parameter list of a functions documentation? For example… os.mkdir(path, mode=0o777, *, dir_fd=None) …to be clear I’m ... More on discuss.python.org
🌐 discuss.python.org
8
0
September 21, 2022
🌐
OpenTeams
openteams.com › what-are-python-asterisk-and-slash-special-parameters-for
What Are Python Asterisk and Slash Special Parameters For? | OpenTeams | AI you own
July 9, 2026 - Whenever you think of Python’s asterisk operator (*), you most likely think of multiplication or exponentiation. Similarly, you probably associate the forward slash operator (/) with division. But you can also use the bare asterisk and slash as special parameters in function headers.
🌐
Scaler
scaler.com › home › topics › what is the asterisk operator in python?
What is the Asterisk Operator in Python? - Scaler Topics
November 22, 2022 - Asterisk(*) may function as an operator or even an indicator for passing varying numbers of parameters. In addition to packing them up, it is also able to unpack dictionaries, lists, and range objects. Operators in Python.
🌐
Real Python
realpython.com › python-asterisk-and-slash-special-parameters
What Are Python Asterisk and Slash Special Parameters For? – Real Python
March 18, 2026 - Whenever you think of Python’s asterisk operator (*), you most likely think of multiplication or exponentiation. Similarly, you probably associate the forward slash operator (/) with division. But you can also use the bare asterisk and slash as special parameters in function headers.
🌐
Bas
bas.codes › posts › python-asterisks
All you need to know about Asterisks in Python - Bas codes
May 25, 2022 - If you call the last function with ... 'arg1, arg2' The asterisk (*) and double asterisk (**) operators do not only work for function definitions and calls, but they can be used to construct lists and dictionaries....
🌐
Trey Hunner
treyhunner.com › 2018 › 10 › asterisks-in-python-what-they-are-and-how-to-use-them
Asterisks in Python: what they are and how to use them
October 11, 2018 - You need to be careful when using ** multiple times though. Functions in Python can’t have the same keyword argument specified multiple times, so the keys in each dictionary used with ** must be distinct or an exception will be raised.
Find elsewhere
🌐
Medium
medium.com › understand-the-python › understanding-the-asterisk-of-python-8b9daaa4a558
Understanding the asterisk(*) of Python | by mingrammer | Understanding the Python | Medium
August 21, 2019 - Python has plentiful types of operations compared to other languages. Especially, the Asterisk(*) that is one of the most used operators in Python allows us to enable various operations more than just multiplying the two numbers.
🌐
Medium
medium.com › analytics-vidhya › the-magic-of-asterisks-in-python-aed3538deef9
The Magic of Asterisks in Python. Packing and Unpacking | by Syahrul Hamdani | Analytics Vidhya | Medium
April 2, 2020 - So, by preceding a parameter with double asterisks (**) will treat it as a packing argument that yields a Python dictionary. The keyword name will act as a dictionary key and the argument will act as a dictionary value.
🌐
Reddit
reddit.com › r/python › all you need to know about asterisks in python
r/Python on Reddit: All you need to know about Asterisks in Python
May 25, 2022 - In this article we learn about the deconstruction operators (`*` and `**`) in Python and how to use them with functions, list, and dictionaries.
🌐
DataCamp
datacamp.com › tutorial › usage-asterisks-python
Usage of Asterisks in Python | DataCamp
June 6, 2019 - Most of us use asterisks as multiplication and power operators, but they also have a wide range of operations being used as a prefix operator in Python.
🌐
TutorialsPoint
tutorialspoint.com › article › usage-of-asterisks-in-python
Usage of Asterisks in Python
March 15, 2026 - The asterisk operators in Python serve multiple purposes: * for multiplication, sequence repetition, unpacking iterables, and collecting variable arguments, while ** handles keyword arguments and dictionary unpacking.
🌐
Srce Cde
srcecde.me › posts › 2024 › 02 › asterisk-and-forward-slash-as-function-parameters-python
Asterisk (*) and forward slash (/) as function parameters in python | Srce Cde
February 17, 2024 - In Python, the asterisk (*) and forward slash (/) symbols are used in function signature/definition to denote flexible argument passing mechanisms. These symbols enable functions to accept a varying number of arguments by position or as keyword ...
🌐
DEV Community
dev.to › siddharth2016 › python-asterisks-2j6i
Python Asterisks - DEV Community
March 21, 2021 - Asterisk symbol most common use case is for accomplishing multiplication tasks (that we all know) and in python, it provides yet another much-needed task of exponentiation with the help of using 2 asterisks instead of 1 (amazing, right !).
🌐
Python Engineer
python-engineer.com › courses › advancedpython › 19-asterisk
The Asterisk (*) operator - Advanced Python 19 - Python Engineer
The asterisk sign (*) can be used for different cases in Python: - Multiplication and power operations - Creation of list, tuple, or string with repeated elements - *args , **kwargs , and keyword-only parameters - Unpacking lists/tuples/dictionaries ...
🌐
Towards Data Science
towardsdatascience.com › home › latest › 5 syntactic applications of asterisks in python, the last one is surprising
5 Syntactic Applications Of Asterisks In Python, The Last One Is Surprising | Towards Data Science
January 13, 2025 - For example, we can write such a function to sum all the numbers that passed in. To allow the parameter to be variable-length, we need to add an asterisk in front of the parameter name.
🌐
Python.org
discuss.python.org › python help
What is the significance of a single, lone asterisk in a functions documentation? - Python Help - Discussions on Python.org
September 21, 2022 - Hello all, I keep coming across this and my Google Fu (actually DuckDuckGo Judo) cannot find the answer; what is the significance of a single, lone asterisk in the local parameter list of a functions documentation? For example… os.mkdir(path, mode=0o777, *, dir_fd=None) …to be clear I’m ...
🌐
Geek Python
geekpython.in › asterisk-in-python
Understanding the Different Uses of the Asterisk(*) in Python
March 16, 2024 - Asterisk (*) can be used in multiplication, exponentiation, packing/unpacking, formatting strings, Tuple/Set unpacking and to control how an argument should be passed in a function.
🌐
GUVI
guvi.in › blog › programming languages › python args and kwargs explained: *args, **kwargs & unpacking with code examples
Python Args and Kwargs Explained (2026 Guide)
July 23, 2026 - Let’s break down exactly what Python args and kwargs do, one use case at a time. A single asterisk (*) placed before a parameter name tells Python two things: there’s no fixed number of input values, and whatever gets passed in should be collected as a tuple.