Object Oriented Programming >> Using Databases with Python
*Please Wait 15 Seconds To Get The Pdf Loaded
* Please Disable Internet Download Manager (IDM) To View This Pdf.
L^U&M56q1Mzm
Question 1
Which came first, the instance or the class?
class
method
function
instance
Question 2
In Object Oriented Programming, what is another name for the “attributes” of an object?
methods
portions
messages
forms
fields
Question 3
At the moment of creation of a new object, Python looks at the _________ definition to define the structure and capabilities of the newly created object.
method
class
cache
instance
constructor
Question 4
Which of the following is NOT a good synonym for “class” in Python?
pattern
direction
template
blueprint
Question 5
What does this Python statement do if PartyAnimal is a class?
Clear out all the data in the PartyAnimal variable and put the old values for the data in zap
Copy the value from the PartyAnimal variable to the variable zap
Use the PartyAnimal template to make a new object and assign it to zap
Subtract the value of the zap variable from the value in the PartyAnimal variable and put the difference in zap
Question 6
What is the syntax to look up the fullname attribute in an object stored in the variable colleen?
colleen[‘fullname’]
colleen.fullname
colleen::fullname
colleen->fullname
Question 7
Which of these statements is used to indicate that class A will inherit all the features of class B?
A=B++;
class A(B) :
class A inherits B :
class A extends B :
class A instanceOf B :
Question 8
What keyword is used to indicate the start of a method in a Python class?
break
def
function
continue
Question 9
What is “self” typically used for in a Python method within a class?
The number of parameters to the method
To set the residual value in an expression where the method is used
To refer to the instance in which the method is being called
To terminate a loop
Question 10
What does the Python dir() function show when we pass an object into it as a parameter?
It shows the methods and attributes of the object
It shows the number of parameters to the constructor
It shows the type of the object
It shows the parent class
Question 11
Which of the following is rarely used in Object Oriented Programming?
Constructor
Attribute
Destructor
Method