Coursera课程Python for everyone:Quiz: Object Oriented Programming
Object Oriented Programming
11?試題
1.?Which came first, the instance or the class?
instance
class
function
method
2.?In Object Oriented Programming, what is another name for the "attributes" of an object?
portions
messages
forms
fields
methods
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.
cache
class
constructor
method
instance
4.?Which of the following is?NOT?a good synonym for "class" in Python?
blueprint
pattern
direction
template
5.?What does this Python statement do if PartyAnimal is a class?
zap = PartyAnimal()Copy the value from the PartyAnimal variable to the variable zap
Subtract the value of the zap variable from the value in the PartyAnimal variable and put the difference in zap
Clear out all the data in the PartyAnimal variable and put the old values for the data in zap
Use the PartyAnimal template to make a new object and assign it to zap
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
7.?Which of these statements is used to indicate that class A will inherit all the features of class B?
class A(B) :
class A inherits B :
class A extends B :
A=B++;
class A instanceOf B :
8.?What keyword is used to indicate the start of a method in a Python class?
break
function
continue
def
9.?What is "self" typically used for in a Python method within a class?
To refer to the instance in which the method is being called
The number of parameters to the method
To set the residual value in an expression where the method is used
To terminate a loop
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
11.?Which of the following is rarely used in Object Oriented Programming?
Method
Attribute
Constructor
Destructor
總結(jié)
以上是生活随笔為你收集整理的Coursera课程Python for everyone:Quiz: Object Oriented Programming的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Coursera课程Python for
- 下一篇: Coursera课程Python for