Py4e: Chapter 14
class
shape of an object, template (the cookie cutter) string
state
the set of values of the attributes of a particular object.
object
also called an instance. the cookie to the cookie cutter, (behavior defined by the class)
Which came first, the instance or the class?
class
Which of these statements is used to indicate that class A will inherit all the features of class B?
class A(B) :
What is the syntax to look up the fullname attribute in an object stored in the variable colleen?
colleen.fullname
Which of the following is rarely used in Object Oriented Programming?
Destructor
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
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
What does this Python statement do if PartyAnimal is a class? zap = PartyAnimal()
Use the PartyAnimal template to make a new object and assign it to zap
method
a verb; the object's abilities; the function inside the object. string.uppercase( ) list.append( )
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.
class
attributes
data
What keyword is used to indicate the start of a method in a Python class?
def
Which of the following is NOT a good synonym for "class" in Python?
direction
In Object Oriented Programming, what is another name for the "attributes" of an object?
not methods or forms or messages