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 ( _ )