Top 1000+ Solved Problem Solving and Python Programming MCQ Questions Answer
Q. Program code making use of a given module is called a of the module.
a. client
b. docstring
c. interface
d. modularity
Q. is a string literal denoted by triple quotes for providing the specifications of certain program elements.
a. interface
b. modularity
c. client
d. docstring
Q. Which of the following is true about top- down design process?
a. the details of a program design are addressed before the overall design
b. only the details of the program are addressed
c. the overall design of the program is addressed before the details
d. only the design of the program is addressed
Q. Which of the following is not a valid namespace?
a. global namespace
b. public namespace
c. built-in namespace
d. local namespace
Q. 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
Q. 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
Q. 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
Q. 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