हिंदी

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

Advertisements
Advertisements

प्रश्न

Differentiate between the following with the help of an example:

Argument and Parameter

अंतर स्पष्ट करें

उत्तर

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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Functions - Exercise [पृष्ठ १७०]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 11
अध्याय 7 Functions
Exercise | Q 6. a) | पृष्ठ १७०
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×