Difference between Argument and Parameter
Programming Languages
Programming Languages

Programmers use the terms argument and parameter interchangeably. When someone says argument or parameter, they mean the same thing. However, there is a difference.

Parameter Vs. Argument

Parameter

  1. Named variables declared in the function definition
  2. Part of the function/method signature
  3. In some programming languages, parameters are also called formal arguments

Argument

  1. Variables or values passed to the function when called
  2. The actual value supplied to the function at runtime
  3. In some programming languages, arguments are also called actual arguments

Parameters are named variables declared in the function definition.

Arguments are variables or values passed to the function when calling it.



This definition is universal, irrespective of programming language. Let us consider the following Python function:



def multiply(x, y):
  return x * y;

multiply(10, 15);

In the above example, the function multiple() expects two parameters: x and y. Next, when the function multiply() is called, two arguments are passed to the function: 10 and 15. Therefore, arguments are runtime values that fill the function parameters.

Difference between Argument and Parameter
Be The First

Join our list to get instant access to new articles and weekly newsletter.

Tagged on:     
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x