Computer Science
What are arguments ? What are parameters ? How are these two terms different yet related ? Give example.
Answer
Arguments — The values being passed through a function-call statement are called arguments.
Parameters — The values received in the function definition/header are called parameters.
Arguments appear in function call statement whereas parameters appear in function header. The two terms are related because the values passed through arguments while calling a function are received by parameters in the function definition.
For example :
def multiply(a, b):
print(a * b)
multiply(3, 4)
Here, a and b are parameters while 3, 4 are arguments.