IT 117: Intermediate to Scripting
Answers to Class 17 Ungraded Quiz
To create a new kind of object, what must you define?
a class
What do you call the special method that is used to create an object?
constructor
In Python what must the special method used to create an object be named?
__init__
What do you call an object that is created from a class?
an instance
Every method in a class must take a certain parameter. What is this parameter?
self
What two kinds of things do you define inside a class?
variables and methods
What do you call the style of programming that uses objects?
Object Oriented Programming
If I were writing a method in a class and wanted to set the value of the
variable inside the class named count to zero,
what Python statement would I write?
self.count = 0
If I had a variable named loan_1 that pointed
to an object which contained the variable principle
and I wanted to set the value of this variable to 1000,
what Python statement would I write?