Computer Science
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.
- Both A and R are true, and R is the correct explanation of A.
- Both A and R are true, and R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Python Functions
3 Likes
Answer
A is true but R is false.
Explanation
Positional arguments must be passed in the order they are defined in the function signature in Python. Python does not automatically assign default values to positional arguments. Default values must be explicitly defined in the function signature, if not provided, the function will raise an error.
Answered By
1 Like
Related Questions
Which network device is used to connect two networks that use different protocols ?
- Modem
- Gateway
- Switch
- Repeater
Which switching technique breaks data into smaller packets for transmission, allowing multiple packets to share the same network resources.
Assertion (A): A SELECT command in SQL can have both WHERE and HAVING clauses.
Reasoning (R): WHERE and HAVING clauses are used to check conditions, therefore, these can be used interchangeably.
- Both A and R are true, and R is the correct explanation of A.
- Both A and R are true, and R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
How is a mutable object different from an immutable object in Python ?
Identify one mutable object and one immutable object from the following:
(1, 2), [1, 2], {1:1, 2:2}, '123'