Python Programming · Foundations
Function Parameters
On this page 9 sections
In 30 seconds
Parameters are the named inputs a function is prepared to receive; arguments are the actual values supplied when it is called. Python lets many ordinary parameters receive values by position or by name. Defaults make an input optional, while *args gathers extra positional values and **kwargs gathers extra named values. Clear parameter A name in a function definition that receives an argument when the function is called. Full entry → choices make one small operation useful in more than one situation.
Why this matters
Parameters are how a program communicates the information a reusable operation needs. In coursework, they help you read function calls accurately and design examples that work with varied inputs. In practical code, sensible parameter names, defaults, and keyword calls make an interface easier to use without memorizing a fragile order. Understanding the binding rules also makes common TypeError messages—such as a missing argument An object or expression supplied in a function call for a parameter. Full entry → or an unexpected keyword—much easier to diagnose.
The college version
Parameters describe a function's input contract
A function definition can name inputs in its parenthesized parameter list. Those names are parameters: placeholders the function can use while it runs. A function call supplies arguments, the concrete objects to bind to those placeholders. For example, in announce("Mina"), name is a parameter if it appears in the definition, and "Mina" is an argument in this particular call. The distinction is small but useful. A parameter describes what a function accepts; an argument describes what a caller provided. This lesson focuses on that input contract, not on how to define an entire function, what it returns, or how names behave outside the call.
A function's parameter list is therefore a small interface. A caller needs to know which inputs are required, which are optional, and which names are meaningful. Good parameter names communicate the role of an input—width is easier to interpret than x when a function calculates an area. Names do not enforce correctness by themselves, but they make a call easier for another person to read and reduce the chance that an ordered value is misunderstood.
For ordinary parameters, Python can bind arguments by position. In greet("Mina", "Welcome"), the first supplied argument goes to the first parameter and the second goes to the second. This is compact, but it depends on remembering the order. If the call names a parameter, Python instead matches the argument by that name: greet(greeting="Welcome", name="Mina"). Keyword calls can make a line more self-explanatory and can state the arguments in a different order. A call may combine styles, but positional arguments must come before keyword arguments. greet("Mina", greeting="Welcome") is valid; placing a positional argument An argument matched to a parameter according to its place in the call. Full entry → after a keyword argument An argument written with a parameter name and =, matched by that name. Full entry → is not.
Defaults make an input optional, with a caveat
A default value A value used for a parameter when the caller omits an argument for it. Full entry → appears after = in a parameter list. In def greet(name, greeting="Hello"), a call that supplies only name uses "Hello" for greeting; a caller can replace it with its own argument. Defaults are appropriate when one choice is conventional but another should remain available. They are not a separate type of parameter, and they do not mean that every input is optional: name remains required in this example.
Python evaluates a default expression once, when the function definition is executed, rather than rebuilding it for every call. That behavior matters for mutable objects such as lists and dictionaries. A default items=[] can retain additions made during an earlier call, which often surprises beginners who expected a new empty list. When a function needs a fresh list if none was supplied, a common pattern is items=None, followed by an initialization inside the function when items is None. The point is not that lists are forbidden as inputs; it is that a shared default object should be intentional.
Collecting a flexible number of arguments
Sometimes a function genuinely accepts an open-ended set of inputs. A parameter written as *args collects extra positional arguments into a tuple. The spelling args is a convention, not a magic word; the leading * creates the collecting behavior. For a call such as label("notebook", "blue", "lined"), a first ordinary parameter can receive "notebook", and the remaining positional values can be collected as ('blue', 'lined'). A tuple preserves the collected sequence and is useful when the function needs to examine any number of similarly ordered values.
Likewise, **kwargs collects extra keyword arguments into a dictionary whose keys are the supplied keyword names. Again, kwargs is conventional; **settings has the same behavior. In label("notebook", urgent=True), a **settings parameter can receive {'urgent': True} after ordinary parameters have been matched. These tools are flexible, but they can make an interface harder to discover if used merely to avoid choosing clear parameters. Prefer explicit named parameters for the important, expected inputs. Use *args or **kwargs when an arbitrary collection is truly part of the function's contract, and document what those collected values mean.

Eli explains
The same idea, in plain words
Explain it like I’m 10
Imagine a smoothie counter. The recipe card has blanks for what the blender needs: a fruit and, perhaps, a milk choice. Those blanks are parameters. When a customer says “banana” and “oat milk,” those supplied choices are arguments. The same recipe card can make different smoothies because different customers can fill in its blanks.
Giving the choices by position is like saying the first word is fruit and the second is milk. Giving them by name is like attaching labels: fruit="banana" and milk="oat". A default is the counter's usual milk if no one asks for another. *args is a basket for extra unlabelled toppings, and **kwargs is a clipboard for extra labeled requests.
Picture it like this
A function's parameters are the labeled blanks on an order form; arguments are the entries a customer writes into those blanks.
Where the picture stops working
A real order form may reject or charge for choices, while parameters do not decide a program's business rules by themselves. Also, Python's exact rules for binding arguments are defined by the language, not by a human cashier.
Worked example
Run this Python 3 code:
def make_label(item, count=1, *tags, **settings):
return {"item": item, "count": count, "tags": tags, "settings": settings}
print(make_label("notebook", 2, "blue", "lined", urgent=True))The first two positional arguments bind item to "notebook" and count to 2, so the default count is not used. The two remaining positional arguments are collected by *tags into ('blue', 'lined'). The named argument urgent=True does not match an ordinary parameter, so **settings collects it as {'urgent': True}. The printed result is {'item': 'notebook', 'count': 2, 'tags': ('blue', 'lined'), 'settings': {'urgent': True}}.
Key takeaway
Parameters describe the inputs a function can accept, and arguments supply those inputs in a call. Use explicit parameters when possible, defaults for genuine optional choices, and *args or **kwargs only when flexible collections are part of the intended interface.
Quick check
3 questions here, of 5 in this lesson’s practice set. Answers stay hidden until you check.
In
Which call is valid for def greet(name, greeting="Hello"): ...?
A function is defined as def record(item, *tags): .... What does record("pen", "blue", "sale") bind to tags?
Study tools & related lessonsYou’ll learn to · Common mistakes · Easily confused · Key vocabulary · Related
You’ll learn to
- Distinguish a parameter from an argument.
- Apply positional and keyword arguments to an ordinary Python parameter list.
- Explain when a default value is used and why mutable defaults are risky.
- Predict the tuple and dictionary formed by
*argsand**kwargs. - Choose a clear calling style for a small function.
Common mistakes
Calling every supplied value a parameter.
Use parameter for the name in the definition and argument for the value in a call.
Putting a positional argument after a keyword argument.
Place positional arguments first, then use keyword arguments.
Assuming a default expression is rebuilt on each call.
Remember that Python evaluates a default once at function definition time; avoid mutable defaults when a fresh object is intended.
Treating
argsandkwargsas magic names.The
*or**changes collection behavior; the names after them are conventions.
Easily confused
parameter vs. argument
A parameter is named in the function definition; an argument is supplied by a particular call.
positional argument vs. keyword argument
Position matches by order, while a keyword matches by the parameter name.
`*args` vs. `**kwargs`
A single star collects extra positional values in a tuple; two stars collect extra named values in a dictionary.
Key vocabulary
- parameter
- A name in a function definition that receives an argument when the function is called.
- argument
- An object or expression supplied in a function call for a parameter.
- positional argument
- An argument matched to a parameter according to its place in the call.
- keyword argument
- An argument written with a parameter name and
=, matched by that name. - default value
- A value used for a parameter when the caller omits an argument for it.
- `*args`
- Conventional name for a starred parameter that collects extra positional arguments into a tuple.
- `**kwargs`
- Conventional name for a double-starred parameter that collects extra keyword arguments into a dictionary.
Sources & references
- The Python Tutorial — 4. More Control Flow Tools (if Statements) — Python Software Foundation
- The Python Language Reference — 6.3.4 Calls — Python Software Foundation
EliExplains lessons are original prose written from the open, credible references above. See Copyright & Licensing.
Researched 2026-08-19
Educational content only. It is not medical, legal or professional advice. Found an error? Tell us.

