KnowledgeBoat Logo

Computer Science

Assertion (A): To use positional arguments, the arguments need to be passed in the same order as their respective parameters in the function definition.

Reasoning (R): If three positional arguments are to be passed to the function, the first argument will be assigned to the first parameter, second argument to the second parameter and the third argument to the third parameter.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Python Functions

1 Like

Answer

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

Explanation
Positional arguments in Python must be passed in the same order as their respective parameters in the function definition. This means that the first argument passed will be assigned to the first parameter, the second argument to the second parameter, and so on. As positional arguments are those arguments in a function call that match the number and order of arguments as defined in the function definition.

Answered By

1 Like


Related Questions