0 votes
295 views
in Computer Science by (8.5k points)
Assertion (A): Positional arguments in Python functions must be passed in the exact order in which they are defined in the function signature.

Reasoning (R): This is because Python functions automatically assign default values to positional arguments.

Mark the correct choice as:

(A) Both A and R are true and R is the correct explanation for A

(B) Both A and R are true and R is not the correct explanation for A

(C) A is True but R is False

(D) A is False but R is True

1 Answer

0 votes
by (56.5k points)
 
Best answer

Correct option is (C) A is True but R is False

Positional arguments in Python functions must be passed in the exact order in which they are defined in the function signature because Python matches these arguments by their position when the function is called.

For example:

def my_function(a, b=2):

    print(a, b)

...