Q. What is the difference between the formal parameters and actual parameters? What are their alternative names? Also, give a suitable Python code to illustrate both.


Answer :-

Actual Parameter is a parameter, which is used in function call statement to send the value from calling function to the called function. It is also known as Argument.

Formal Parameter is a parameter, which is used in function header of the called function to receive the value from actual parameter. It is also known as Parameter.

For example :-

def addEm(x, y, z):
    print(x + y + z)
addEm(6, 16, 26)

In the above code, actual parameters are 6, 16 and 26; and formal parameters are x, y and z.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post