- Home
- Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion. Non-default arguments cannot
Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion. Non-default arguments cannot follow default arguments in a function call.
Reason. A function call can have different types of arguments.
Answer
(b)
Both Assertion and Reason are true but Reason is not the correct explanation of Assertion.
Explanation
In a function call, any parameter cannot have a default value unless all parameters appearing on its right have their default values. Hence, non-default arguments cannot follow default arguments in a function call. Python supports three types of formal arguments :
- Positional arguments
- Default arguments
- keyword arguments