Computer Science, asked by study5833, 1 month ago

What is the significance of parameters in a function argument?

(Please no answers copied from any search engine)​

Answers

Answered by totaloverdose10
0

Answer:

A function can take parameters which are just values you supply to the function so that the function can do something utilizing those values. These parameters are just like variables except that the values of these variables are defined when we call the function and are not assigned values within the function itself.

Parameters are specified within the pair of parentheses in the function definition, separated by commas. When we call the function, we supply the values in the same way. Note the terminology used - the names given in the function definition are called parameters whereas the values you supply in the function call are called arguments.

Example Using Function Parameters

#!/usr/bin/python

# Filename: func_param.py

def printMax(a, b):

if a > b:

 print a, 'is maximum'

else:

 print b, 'is maximum'

 

printMax(3, 4) # directly give literal values

x = 5

y = 7

printMax(x, y) # give variables as arguments

Output

$ python func_param.py

4 is maximum

7 is maximum

Explanation:

Similar questions