In our previous posts, we created simple functions that performed the same task every time they were called. Our display_welcome_banner()
function from Post #84 was useful, but it wasn’t very flexible—it couldn’t greet different users by name. To make functions truly powerful and reusable, we need a way to pass information into them.
In this post, we will learn the mechanism for doing just that. We’ll clarify two of the most important and often-confused terms in programming: parameters and arguments.
Parameters: The Placeholders in the Definition
A parameter is a variable that you list inside the parentheses of a function definition. It acts as a named placeholder, a “slot” that waits to receive a value when the function is called.
Think of it like a blank space in a form letter: “Dear _______
, you have won a prize!” The blank space is the parameter.
Let’s upgrade our welcome function to accept a name.
# 'user_name' is the PARAMETER
def display_welcome_banner(user_name):
print("--------------------")
print(f"Welcome, {user_name}!")
print("Have a great day!")
print("--------------------")
Here, user_name
is a parameter. It’s a variable that exists only inside this function, and it’s waiting for us to give it a value from the outside world.
Arguments: The Actual Values in the Call
An argument is the actual value or data that you pass into the function when you call it. It’s the piece of information that “fills in the blank” created by the parameter.
If the parameter is the blank space in the form letter, the argument is the name you actually write into that space: “Dear Alice
,”.
Here is how we would call our new function with an argument:
# "Alice" is the ARGUMENT
display_welcome_banner("Alice")
How They Work Together
When you call the function, Python takes the argument you provide and assigns it to the parameter variable.
So, when we run display_welcome_banner("Alice")
, the first thing that happens inside the function is the equivalent of user_name = "Alice"
. The function body then has access to this user_name
variable and can use it.
This makes our function incredibly flexible and reusable.
# The function DEFINITION with its PARAMETER
def display_welcome_banner(user_name):
print("--------------------")
print(f"Welcome, {user_name}!")
print("Have a great day!")
print("--------------------")
# The function CALL with an ARGUMENT
print("First call:")
display_welcome_banner("Alice")
# Another CALL with a different ARGUMENT
print("\nSecond call:")
display_welcome_banner("Bob")
The output will be two different, personalized banners. We wrote the logic once, but can now use it with any data we want.
A Simple Memory Aid
Here’s a simple way to remember the difference:
- Parameter is a Placeholder (in the
def
statement). - Argument is an Actual value (in the call statement).
What’s Next?
Understanding the difference between parameters and arguments is crucial for communicating clearly about your code. You define a function with parameters, and you call it with arguments.
In our example, Python knew to assign "Alice"
to the user_name
parameter because of its position. This is the most common way of passing arguments to a function. In Post #87, we will formalize this concept by learning about positional arguments.
Author

Experienced Cloud & DevOps Engineer with hands-on experience in AWS, GCP, Terraform, Ansible, ELK, Docker, Git, GitLab, Python, PowerShell, Shell, and theoretical knowledge on Azure, Kubernetes & Jenkins. In my free time, I write blogs on ckdbtech.com