Question
Question 31 When using the import modulename form of import, the identifiers of the imported module become part of the namespace of the importing module.
Question 31
When using the import modulename form of import, the identifiers of the imported module become part of the namespace of the importing module.
a) True
b False |
Question 32
When a module is imported using the from modulename import identifier form of import, each imported identifier can be referenced without needing to be fully qualified.
True
False
Question 33
When importing a module using the from modulename import * form of import, the private identifiers of the imported module are not imported, but can still be accessed by the importing module
a) True b False |
Question 34
Which of the following is not true of main modules?
| |||
| |||
d) main modules are directly executed. | |||
|
Question 35
The following line of code will:
from math import factorial as simpFact
b) import only the factorial function from the math module and integrate it into the namespace of the client as simpFact instead of factorial. | |||
| |||
|
Question 36
Assuming that the following function exists within a module to be imported into a client, how should the client treat this function?
def largerThan(num1, num2): """ Returns the larger of two numbers """
if num1 > num2: return num1 else: return num2
| |||
c) the client can use this function at will as long as it imported. | |||
|
Question 37
One of the main advantages of functions is that they support divide and conquer programming.
a) True b) False |
Question 38
A Python function helps prevent encapsulation.
a) True False
Question 46 |
Python contains a predefined set of exceptions called standard exceptions.
a)True
b) False |
Question 47
Exceptions that are thrown by a given function must be caught by the function to gracefully handle errors.
a) True b) False |
Question 48
If an exception is thrown all the way back to the main module and not handled there, the program terminates.
a) True
b) False |
What type of error are exceptions designed to catch?
b)run time
| |||
| |||
|
Question 51
Some string methods alter the string they are called on, while others return a new altered version of the string.
a) True
b) False |
Question 53
All raised standard exceptions must be handled in Python.
a) True b) False |
Question 56
The string method "isdigit" returns true if the string applied to contains any digits.
a) True
b) False |
Question 57
All modular designs are a result of a top-down design process.
a) True b) False |
Question 58
When a given function is called it is said to be,
| |||||
| |||||
|
Question 59
String arguments may be modified within a function resulting in a changed value in the calling module.
a) True b) False |
Question 60
For a variable to be global is must be defined inside a function within the main module.
a) True b) False |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started