Functions · Class 11 · CBSE · Science Computer Science

Explain the difference between formal parameters and actual parameters in Python functions. Give a suitable example using a function call.

Practice question from Functions (Class 11 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.

medium · Subjective · Q-DFEDCC

Explain the difference between formal parameters and actual parameters in Python functions. Give a suitable example using a function call.

Answer: Formal parameters are the variables listed in a function definition, while actual parameters are the values or variables supplied when the function is called. For example, in def square(n): return n * n, n is a formal parameter, and in square(5), 5 is the actual parameter. During the call, the value 5 is passed to n.

Solution

Formal parameters receive values inside the function definition, whereas actual parameters provide those values during a function call. In square(5), n is formal and 5 is actual.

More from Functions

All of Functions

Practise more Computer Science

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed