KnowledgeBoat Logo

Computer Science

Assertion. Non-default arguments cannot follow default arguments in a function call.

Reason. A function call can have different types of arguments.

Python Functions

1 Like

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 :

  1. Positional arguments
  2. Default arguments
  3. keyword arguments

Answered By

3 Likes


Related Questions