Computer Science
Assertion. A function is a subprogram.
Reason. A function exists within a program and works within it when called.
Python Functions
1 Like
Answer
(a)
Both Assertion and Reason are true and Reason is the correct explanation of Assertion.
Explanation
A function is a subprogram that acts on data and often returns a value. It is a self-contained unit of code that performs a specific task within a larger program. Functions are defined within a program and can be called upon to execute a specific set of instructions when needed.
Answered By
1 Like
Related Questions
Variables defined inside functions can have global scope.
A local variable having the same name as that of a global variable, hides the global variable in its function.
Assertion. Non-default arguments cannot follow default arguments in a function call.
Reason. A function call can have different types of arguments.
Assertion. A parameter having a default in function header becomes optional in function call.
Reason. A function call may or may not have values for default arguments.