Test Index
Functions in Python
© examsnet.com
Question : 20 of 23
Marks:
+1,
-0
Q. 17 and 18 are ASSERTION (A) and REASONING (R) based questions. 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.Assertion (A): To use a function from a particular module, we need to import the module.Reason (R): import statement can be written anywhere in the program, before using a function from that module.
[CBSE 2023 Set 4]
Solution:
Concept:In an Assertion-Reason question, first check each statement on its own, then ask whether the Reason really explains why the Assertion is true.Assertion: A function of a module (for example
sqrt() of math) can be used only after the module is imported: import math. True.Reason: The import statement may be written anywhere in the program, as long as it runs before the function is used. True.Explanation:The Reason tells where the import statement may be placed; it does not explain why a module must be imported (its functions are not loaded into the program until it is imported). So both are true, but R is not the correct explanation of A.Answer:Option B (Both (A) and (R) are true and (R) is not the correct explanation for (A).)© examsnet.com
Go to Question: