Parameter vs Argument
The parameter is the named blank in the function. The argument is the real value that fills it when you call it.
Parameter
A name in a function. It holds the value the function is given later.
A parameter is a name in a function that stands for a value it will be given. It is written in the brackets when the function is made, like width and height. Inside the function, the parameter works like a variable. Each time the function is called, the parameter holds whatever value was passed in. A function can have none, one or many.
Argument
The value you give a function when you call it, like 3 in area(3, 4).
An argument is the real value you hand to a function when you call it. In area(3, 4), the arguments are 3 and 4. Each argument fills one of the function's parameters, in order. Arguments can be numbers, strings, variables or whole expressions. Some languages also let you pass them by name, like area(height=4, width=3).
In one line
- Parameter
- A name in a function. It holds the value the function is given later.
- Argument
- The value you give a function when you call it, like 3 in area(3, 4).