KnowledgeBoat Logo

Computer Science

Assertion (A): In Python, a function can have default arguments.

Reasoning (R): Default arguments in Python functions are assigned values when the function is defined, and they can be used if no value is passed during the function call.

Python Functions

3 Likes

Answer

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

Explanation — In Python, a function can have default arguments. These default values are specified in the function header during the function definition. The default values for parameters are used only if no value is provided for that parameter in the function call.

Answered By

3 Likes


Related Questions