Classes
Classes 2
Understanding Code
Vocabulary
Free Form
100

This is a specific “instance” created from a class, like dog = Dog().

What is an object?

100

In the analogy of blueprints and houses, the blueprint represents what?

What is the class?

100

What is the output of this code?

What is pong?

100

The term for assigning an initial value to a variable.

What is initialization?

100

Explain the reasons that classes are helpful.

What is classes let you package data + behavior into a single, reusable unit, which scales much better than separate variables and functions 

200

In a class, this first parameter refers to the current object (instance).

What is self?

200

In the analogy of blueprints and houses, the house represents what?

What is an object/instance?

200

What is wrong with this code?

It is missing an argument for b.f(#)

200

Inputs to a function are called this.

What are arguments?

200

Why might it be useful to track the instances of a class? 

What is it allows tasks to be performed on each instance (e.g., searching, updating values, etc.)

300

This operator/notation/punctuation is used to access an object’s attributes and methods (example: dog2.talk()).

What is the dot operator (.)

300

A programmed procedure defined as part of a class and included in any object of that class.

What is a method?

300

What is the value of c1.v after this code is run?

What is 10?

300

This is the process of “make me a new object” from a class.

What is instantiation?

300
Explain the difference between testing and debugging.
Debugging: correcting errors

Testing: Validating outputs and checking robustness (e.g., invalid inputs, missing files, etc).

400

This method sets an object’s initial attributes / instance variables (initial state)?

What is the __init__ method?

400

You want all instances to share a single counter like total_players. This should be stored as a __________ variable (defined at the class level).

What is a class variable (class attribute)?

400

What prints?

What is 8?

400

The names listed in a function definition that receive the incoming values.

What are parameters?

400

These are the types of data (strings, integers, lists, etc.) can be included as class attributes.

What is all types of data?

500

This is the name of a special method that is automatically called when you create a new object.

What is __init__ or constructor?

500

What is the key difference between self.x and x inside a method, assuming x wasn’t passed in as a parameter?

Self.x is an attribute of an object; x would be a local variable (and may be undefined).

500

What prints?

What is ['x']

500

Functional decomposition is ____?

What is breaking a program into functions to reduce repetition and improve readability.

500

Describe abstraction

What is the process of managing complexity by hiding unnecessary details and exposing only essential features through simplified interfaces 

M
e
n
u