11. Which of the following is false about “import modulename” form of import?
a) The namespace of imported module becomes part of importing module
b) This form of import prevents name clash
c) The namespace of imported module becomes available to importing module
d) The identifiers in module are accessed as: modulename.identifier
12. Which of the following is false about “from-import” form of import?
a) The syntax is: from modulename import identifier
b) This form of import prevents name clash
c) The namespace of imported module becomes part of importing module
d) The identifiers in module are accessed directly as: identifier
13. Which of the statements about modules is false?
a) In the “from-import” form of import, identifiers beginning with two underscores are private and aren’t imported
b) dir() built-in function monitors the items in the namespace of the main module
c) In the “from-import” form of import, all identifiers regardless of whether they are private or public are imported
d) When a module is loaded, a compiled version of the module with file extension .pyc is automatically produced
14. What will be the output of the following Python code?
from math import factorial
print(math.factorial(5))
a) 120
b) Nothing is printed
c) Error, method factorial doesn’t exist in math module
d) Error, the statement should be: print(factorial(5))
15. What is the order of namespaces in which Python looks for an identifier?
a) Python first searches the global namespace, then the local namespace and finally the built-in namespace
b) Python first searches the local namespace, then the global namespace and finally the built-in namespace
c) Python first searches the built-in namespace, then the global namespace and finally the local namespace
d) Python first searches the built-in namespace, then the local namespace and finally the global namespace
16. What is returned by math.ceil(3.4)?
a) 3
b) 4
c) 4.0
d) 3.0
17. What is the value returned by math.floor(3.4)?
a) 3
b) 4
c) 4.0
d) 3.0
18. What will be the output of print(math.copysign(3, -1))?
a) 1
b) 1.0
c) -3
d) -3.0
19. What is displayed on executing print(math.fabs(-3.4))?
a) -3.4
b) 3.4
c) 3
d) -3
20. Is the output of the function abs() the same as that of the function math.fabs()?
a) sometimes
b) always
c) never
d) none of the mentioned