In a few words, they're data that gets "passed into" the function to tell it what to do. Wikipedia has details.

http://en.wikipedia.org/wiki/Function_argument

For instance, your hi() function might need to know who to say hello to:

def hi(person):
    print "Hi there " + person + ", how are you?"

Or a mathematical function might need a value to operate on:

def square(x):
     return x * x
Answer from user149341 on Stack Overflow
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ function-argument
Python Function Arguments (With Examples)
Both values are passed during the function call. Hence, these values are used instead of the default values. ... Only one value is passed during the function call. So, according to the positional argument 2 is assigned to argument a, and the default value is used for parameter b.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_arguments.asp
Python Function Arguments
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Training ... Information can be passed into functions as arguments.
People also ask

What are the types of Python function arguments I should know?
The main types include positional, keyword, default, and arbitrary arguments (*args, **kwargs). Each type helps you handle data more flexibly.
๐ŸŒ
wscubetech.com
wscubetech.com โ€บ resources โ€บ python โ€บ function-argument
Function Arguments in Python: All Types With Examples
Can I use default values in Python functions with arguments?
Yes, you can assign default values to function parameters. If you don't pass a value for those arguments, Python uses the default one youโ€™ve defined in the function.
๐ŸŒ
wscubetech.com
wscubetech.com โ€บ resources โ€บ python โ€บ function-argument
Function Arguments in Python: All Types With Examples
How does Python handle function arguments?
Python matches arguments to parameters by position or name. It uses tuples for *args and dictionaries for **kwargs, giving you powerful options to manage input.
๐ŸŒ
wscubetech.com
wscubetech.com โ€บ resources โ€บ python โ€บ function-argument
Function Arguments in Python: All Types With Examples
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ types-of-arguments-in-python-1
Types of Arguments in Python - GeeksforGeeks
July 23, 2025 - **kwargs in Python (Keyword Arguments): Collects extra keyword arguments passed to a function into a dictionary. Example 1 : Handling Variable Arguments in Functions
๐ŸŒ
Real Python
realpython.com โ€บ ref โ€บ glossary โ€บ argument
argument | Python Glossary โ€“ Real Python
In this example, you first call greet() with positional arguments "Alice" and "Hello". In the second call, you use keyword arguments name="Bob" and greeting="Hi". The function uses print() to display a message formatted with an f-string.
Top answer
1 of 8
10

In a few words, they're data that gets "passed into" the function to tell it what to do. Wikipedia has details.

http://en.wikipedia.org/wiki/Function_argument

For instance, your hi() function might need to know who to say hello to:

def hi(person):
    print "Hi there " + person + ", how are you?"

Or a mathematical function might need a value to operate on:

def square(x):
     return x * x
2 of 8
7

This is not a Python question, but rather a generic programming question. A very basic one.


Before answering the question about arguments, and in view of the other questions you asked, it is useful to discuss the concept of variables.
A variable is a named piece of memory where information of interest to the underlying program can be stored and retrieved. In other words, it is a symbolic name, chosen by the programmer, that is associated to its contents. Using various language constructs generally known as assignments, the programmer can read or write the contents of a variable.
It is important to note that the value (i.e. the content) of a variable needn't be defined when the program is written. It is only necessary at run-time. This allows the program to describe actions to be performed on symbolic elements without knowing exactly the value these elements have. Consider this snippet, part of a bigger program:

# ... some logic above
ball_volume = 4.0 / 3 * math.pi * ball_radius
if ball_volume > 200:
   print ("Man, that's a big ball")
# ... more logic below

At the time the program is written one doesn't need to know the actual value of ball_radius; yet, with the assumption that this variable will contain the numeric value of some hypothetical ball, the snippet is capable of describing how to compute the ball's volume. In this fashion, when the program is running, and somehow (more on this later) the ball_radius variable has been initialized with some appropriate value, the variable ball_volume can too be initialized and used, here in the conditional statement (if), and possibly below. (At some point the variable may go out-of-scope, but this concept which controls when particular variables are accessible to the program is well beyond this primer).
In some languages the type of data that may be associated with a particular variable needs to be explicitly defined and cannot change. For example some variables could hold only integer values, other variables string values (text) etc. In Python there is no such restriction, a variable can be assigned and re-assigned to any type of data, but of course, the programmer needs to keep track of this for example to avoid passing some text data to a mathematical function.

The data stored inside variable may come from very different sources. Many of the examples provided in tutorials and introductory documentation have this data coming from keyboard input (as when using raw_input as mentioned in some of your questions). That is because it allows interactive tests by the people trying out these tutorial snippets. But the usefulness of programs would be rather limited if variables only get their data from interactive user input. There are many other sources and this is what makes programming so powerful: variables can be initialized with data from:

  • databases
  • text files or files various text-base formats (XML, JSON, CSV..)
  • binary files with various formats
  • internet connections
  • physical devices: cameras, temperature sensors...

In a nutshell, Arguments, also called Parameters, are variables passed to the function which [typically] are used to provide different output and behavior from the function. For example:

>>> def say_hello(my_name):
...    print("Hello,", my_name, "!")

>>> say_hello("Sam")
Hello, Sam !
>>> customer_name = "Mr Peter Clark"    #imagine this info came from a database
>>> # ...
>>> say_hello(customer_name)
Hello, Mr Peter Clark !
>>>

In the example above, my_name is just like any local variable of the say_hello function; this allows the function to define what it will do with the underlying value when the function is called, at run-time.
At run-time, the function can be called with an immediate value (a value that is "hard-coded" in the logic, such as "Sam" in the example), or with [the value of] another variable (such as customer_name). In both cases the value of the function's my_name variable gets assigned some value, "Sam" and "Mr Peter Clark" respectively. In the latter case, this value is whatever the customer_name variable contains. Note that the names of the variables used inside the function (my_name) and when the function is called (customer_name) do not need to be the same. (these are called the "formal parameter(s)" and the "actual parameters" respectively)

Note that while typically most arguments as passed as input to a function, in some conditions, they can be used as output, i.e. to provide new/modified values at the level of the logic which called the function. Doing so requires using, implicitly or explicitly, the proper calling convention specification (See Argument passing conventions below)


Now... beyond this very basic understanding of the purpose of parameters, things get a little more complicated than that (but not much). I'll discuss these additional concepts in general and illustrate them as they apply to Python.

Default values for arguments (aka "optional" arguments)
When the function is declared it may specify the default value for some parameters. These values are used for the parameters which are not specified when the function is called. For obvious reasons these optional parameters are found at the end of the parameter list (otherwise the language compiler/interpreter may have difficulty figuring out which parameter is which...)

>>> def say_hello(dude = "Sir"):
...     print("Hello,", dude, "!")
...
>>> say_hello()
Hello, Sir !
>>> say_hello("William Gates")
Hello, Bill !            #just kidding ;-)
Hello, William Gates !   # but indeed. works as the original function when param
                         # is specified

Variable number of parameters
In some cases it may be handy to define a function so that it may accept a variable number of parameters. While such lists of parameter values ultimately get passed in some kind of container (list, array, collection...) various languages offers convenient ways of accessing such parameter values.

>>> def add_many(operand1, *operands):
...    Sum = operand1
...    for op in operands:
...       Sum += op
...    return Sum
...
>>> add_many(1, 3, 5, 7, 20)
36
>>> add_many(1, 3)
4

Named Arguments (Keyword Arguments)
With Python and a few other languages, it is possible to explicitly name the arguments when calling the function. Whereby argument passing is by default based a positional basis ("1st argument, 2nd argument etc.), Python will let you name the arguments and pass them in any order. This is mostly a syntactic nicety, but can be useful, in combination with default arguments for functions that accept very many arguments. It is also a nice self-documenting feature.

>>> def do_greetings(greeting, person):
...    print (greeting, "dear", person, "!")
...
>>> do_greetings(person="Jack", greeting="Good evening")
Good evening dear Jack !

In Python, you can even pass a dictionary in lieu of several named arguments for example, with do_greetingsas-is, imagine you have a dictionary like:

>>> my_param_dict = {"greeting":"Aloha", "person":"Alan"}

>>> do_greetings(**my_param_dict)
Aloha dear Alan !

In closing, and while the fancy ways of passing arguments, and the capability for methods to handle variable number of arguments are useful features of various languages, two key concepts need to be mentioned:

Argument passing convention : by value or by reference
So far all the functions we used didn't alter the value of the parameters passed to them. We can imagine however many instances when functions may want to do this, either to perform some conversion or computation on the said values, for its own internal use, or to effectively change the value of the variable so that the changes are reflected at the level of logic which called the function. That's where argument passing conventions come handy...
arguments which are passed by value may be altered by the function for its own internal computations but are not changed at the level of the calling method.
arguments which are passed by reference will reflect changes made to them, at the level of the calling method.
Each language specifies the ways that arguments are passed. A typical convention is to pass integers, numberic values and other basic types by value and to pass objects by reference. Most language also offer keyword that allow altering their default convention.

In python all arguments are passed by reference. However a few variables types are immutable (numbers, strings, tuples...) and they can therefore not be altered by the function.

Implicit "self" or "this" argument of class methods
In object oriented languages, methods (i.e. functions within a class) receive an extra argument that is the value of underlying object (the instance of the class), allowing the method to use various properties members of the class in its computation and/or to alter the value of some of these properties.

in Python, this argument is declared at the level of the method definition, but is passed implicitly. Being declared, it may be named most anything one wishes, although by convention this is typically called self.

>>> class Accumulator:
...   def __init__(self, initialValue = 0):
...        self.CurValue = initialValue
...   def Add(self, x):
...        self.CurValue += x
...        return self.CurValue
...
>>> my_accu = Accumulator(10)
>>> my_accu.Add(5)
15
>>> my_accu.Add(3)
18
๐ŸŒ
Built In
builtin.com โ€บ software-engineering-perspectives โ€บ arguments-in-python
5 Types of Python Function Arguments | Built In
In the below example, the default value is given to argument b and c. ... Default values are evaluated only once at the point of the function definition in the defining scope. So, it makes a difference when we pass mutable objects like a list or dictionary as default values. More on Python: 13 ...
๐ŸŒ
WsCube Tech
wscubetech.com โ€บ resources โ€บ python โ€บ function-argument
Function Arguments in Python: All Types With Examples
November 5, 2025 - Learn about Python function arguments with examples, types, and key points in this step-by-step tutorial. Master how to use them effectively in your code.
Find elsewhere
๐ŸŒ
KDnuggets
kdnuggets.com โ€บ 2023 โ€บ 02 โ€บ python-function-arguments-definitive-guide.html
Python Function Arguments: A Definitive Guide - KDnuggets
After defining a function, you ... the definition of the add() function: num1 and num2 are the parameters and the values used for these parameters in the function call are the arguments....
๐ŸŒ
Real Python
realpython.com โ€บ python-kwargs-and-args
Python args and kwargs: Demystified โ€“ Real Python
November 7, 2023 - This is where *args can be really ... the following example: ... def my_sum(*args): result = 0 # Iterating over the Python args tuple for x in args: result += x return result print(my_sum(1, 2, 3))...
๐ŸŒ
PYnative
pynative.com โ€บ home โ€บ python โ€บ basics โ€บ python function arguments
Python Function Arguments [4 Types] โ€“ PYnative
August 2, 2022 - This is a simple function that takes three arguments and returns their average: def percentage(sub1, sub2, sub3): avg = (sub1 + sub2 + sub3) / 3 print('Average', avg) percentage(56, 61, 73)Code language: Python (python) Run
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ args-kwargs-python
*args and **kwargs in Python - GeeksforGeeks
For example, we want to make a multiply function that takes any number of arguments and is able to multiply them all together. It can be done using *args. Using * the variable that we associate with the * becomes iterable, meaning you can do ...
Published ย  December 11, 2024
๐ŸŒ
Analytics Vidhya
analyticsvidhya.com โ€บ home โ€บ a comprehensive guide to python function arguments
A Comprehensive Guide to Python Function Arguments
April 17, 2024 - In this example, the `add_numbers` function takes two positional arguments, `a` and `b`. When we call the function with the arguments `3` and `5`, it returns the sum of the two numbers: โ€˜ 8`. Python allows us to assign default values to positional arguments.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_functions.asp
Python Functions
Python Functions Python Arguments Python *args / **kwargs Python Scope Python Decorators Python Lambda Python Recursion Python Generators Code Challenge Python Range ... Matplotlib Intro Matplotlib Get Started Matplotlib Pyplot Matplotlib Plotting Matplotlib Markers Matplotlib Line Matplotlib ...
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ python โ€บ python function arguments
Python Function Arguments with Types and Examples - Scaler Topics
November 21, 2023 - Arguments allow us to pass information to the function. In the example above, we provided 5 and 6 as the function arguments for parameters num1 and num2, respectively. There are 4 inherent function argument types in Python, which we can call functions to perform their desired tasks.
๐ŸŒ
Alma Better
almabetter.com โ€บ bytes โ€บ tutorials โ€บ python โ€บ arguments-in-python-functions
Arguments in Python Functions
April 19, 2024 - Discover the versatility of arguments in Python functions. Explore passing, default and keyword arguments. Level up your Python coding with function parameters
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ deep-dive-into-parameters-and-arguments-in-python
Python Function Parameters and Arguments - GeeksforGeeks
Types of arguments in python ยท A parameter is the variable defined within the parentheses when we declare a function. Example: Python ยท # Here a,b are the parameters def sum(a,b): print(a+b) sum(1,2) Output ยท 3 ยท An argument is a value that is passed to a function when it is called.
Published ย  July 23, 2025
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ args-and-kwargs
Python *args and **kwargs (With Examples)
Inside the function, we have a loop which adds the passed argument and prints the result. We passed 3 different tuples with variable length as an argument to the function. Python passes variable length non keyword argument to function using *args but we cannot use this to pass keyword argument.
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ python_command_line_arguments.htm
Python - Command-Line Arguments
C:\Python311>python hello.py Rajan argument list ['hello.py', 'Rajan'] Hello Rajan. How are you? The command-line arguments are always stored in string variables. To use them as numerics, you can them suitably with type conversion functions. In the following example, two numbers are entered as command-line arguments.
๐ŸŒ
Medium
rs-punia.medium.com โ€บ parameters-vs-arguments-in-python-7252ec93da89
Parameters VS Arguments in Python | by Rampal Punia | Medium
July 5, 2024 - ... def area(length, width): # ... result = area(10, 20) print(result) In this example, 10, and 20 are the arguments that are passed to the area() function....