Fewpal
0 votes
106 views
in Computer by (45.7k points)
closed by

Differentiate between actual parameter(s) and a formal parameter(s) with a suitable example for each.

1 Answer

+1 vote
by (48.9k points)
selected by
 
Best answer

The list of identifiers used in a function call is called actual parameter(s) whereas the list of parameters used in the function definition is called formal parameter(s). 

Actual parameter may be value / variable or expression. 

Formal parameter is an identifier. 

Example: 

def area(side):           # line 1 

return side*side; 

print(area(5))         # line 2 

In line 1, side is the formal parameter and in line 2, while invoking area() function, the value 5 is the actual parameter.

A formal parameter, i.e. a parameter, is in the function definition. An actual parameter, i.e. an argument, is in a function call.

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...