Advertisements
Advertisements
Question
Differentiate between the following with the help of an example:
Argument and Parameter
Distinguish Between
Advertisements
Solution
The parameter is a variable in the declaration of a function. The argument is the actual value of this variable that gets passed to the function when the function is called.
Program:
def create (text, freq):
for i in range (1, freq):
print text
create(5, 4) #function call
Here, in line 1, 'text' and 'freq' are the parameters whereas, in line 4 the values '5' and '4' are the arguments.
shaalaa.com
Arguments and Parameters
Is there an error in this question or solution?
