English

Differentiate between the following with the help of an example: Argument and Parameter - Computer Science (Python)

Advertisements
Advertisements

Question

Differentiate between the following with the help of an example:

Argument and Parameter

Distinguish Between

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?
Chapter 7: Functions - Exercise [Page 170]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 7 Functions
Exercise | Q 6. a) | Page 170
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×