Question 1
Although Python is considered an object-oriented language, its syntax does not enforce data encapsulation.Correct Answer:
TrueQuestion 2
Any object can be pickled before it is saved to a file, and then unpickled as it is loaded from a file into a program.Correct Answer:
TrueQuestion 3
What are the two parts of a rational number? (Choose two.)Correct Answers:
a.
d. Question 4
In Python, when does an object reach the end of its life?Correct Answer:
c. Question 5
If the parenthesized parent class name is omitted from the class definition, the new class is automatically made a subclass of self.Correct Answer:
FalseQuestion 6
Python programmers typically capitalize their own class names to distinguish them from variable names.Correct Answer:
TrueQuestion 7
Most object-oriented languages require the programmer to master the following techniques: data encapsulation, inheritance, and abstraction.Correct Answer:
FalseQuestion 8
What function do you use to save an object utilizing the pickle module?Correct Answer:
c. Question 9
To reduce a rational number to its lowest terms, you first compute the greatest common divisor (GCD) of the numerator and the denominator, using Euclid's algorithm.Correct Answer:
TrueQuestion 10
If the statements in the try clause raise no exceptions, the except clause is skipped and control proceeds to the end of the try-except statement.Correct Answer:
TrueQuestion 11
What concept within object-oriented programming involves the restriction of the manipulation of an object's state by external users to a set of method calls?Correct Answer:
c. Question 12
The function call str(s) is equivalent to the method call s.__str__().Correct Answer:
TrueQuestion 13
What statement is an accurate description of the concept of polymorphism in object-oriented programming?Correct Answer:
c. Question 14
What is the process in which the Python virtual machine recycles its storage known as?Correct Answer:
b. Question 15
The Python interpreter picks out equality from the other comparisons by looking for an __equals__ method when it encounters the == and != operators.Correct Answer:
FalseQuestion 16
In the context of Python objects, what does the pickling process do?Correct Answer:
b. Question 17
What can be used to describe and document the analysis and design of complex software systems?Correct Answer:
b. Question 18
Objects in the natural world and objects in the world of artifacts can be classified using inheritance hierarchies.Correct Answer:
TrueQuestion 19
The scope of an instance variable is the entire module.Correct Answer:
FalseQuestion 20
What type of programming is defined by the term "imperative programming"?Correct Answer:
c. Question 21
The attributes of an object are represented as what type of variables?Correct Answer:
a. Question 22
You are utilizing the pickle.load function to load objects into a program from a file. However, your program raises an exception as soon as the end of the file is reached. What must you do?Correct Answer:
a. Question 23
A class variable is visible to all instances of a class and does not vary from instance to instance.Correct Answer:
TrueQuestion 24
Inheritance allows several different classes to use the same general method names.Correct Answer:
FalseQuestion 25
At the top, or root of the class hierarchy is the most abstract class. What is the name of this class?Correct Answer:
d.
0 comments:
Post a Comment