Chapter 10 Flashcards
TF
New objects are created by invoking a constructor.
True
TF
Functions that live in objects are called instance variables.
False
TF
The first parameter of a Python method definition is called ‘this’.
False
TF
An object may have only one instance variable
False
TF
In data processing, a collection of information about a person or thing is called a file.
False
TF
In python class, the constructor is called __Int__.
True
TF
A docstring is the same thing as a comment.
False
TF
Instance variables go away once a method terminates.
False
TF
Method names should always begin with one or two underscores.
False
TF It is considered bad style to directly access an instance variable outside of a class definition.
True
What Python reserved word starts a class definition?
Class
A method definition with four formal parameters is generally called with how many actual parameters?
Three
A method definition is similar to a(n)…
Function Definition
Within a method definition, the instance variable x could be accessed via which expression?
self.x
A Python convention for defining methods that are “private” to a class is to begin the method name with…
An underscore ( _ )
The term applied to hiding details inside class definitions is…
encapsulation
A Python string literal can span multiple lines if enclosed with…
In a Button widget, what is the data type of the instance variable active?
Bool
Which of the following methods is not part of the Button class in this chapter?
setLabel
Which of the following methods is part of the DieView class in this chapter?
setValue