KnowledgeBoat Logo
|

Computer Science

Assertion (A): Python supports both positional and keyword arguments in functions.

Reasoning (R): Positional arguments are assigned based on their position in the function call, while keyword arguments are assigned based on the name of the parameter.

Python Functions

2 Likes

Answer

Both A and R are true, and R is the correct explanation of A.

Explanation — Python allows both positional and keyword arguments in functions. Positional arguments are passed based on their position in the function call. The first argument passed corresponds to the first parameter in the function definition, the second argument to the second parameter, and so on. While keyword arguments are passed according to the name of the parameter in the function definition.

Answered By

3 Likes


Related Questions