Final 5 Flashcards

1
Q

What is a Try statement?

A

A statement where you put code that might crash so that it will be encapsulated in an “try block” to output a custom error if it doesn’t work as intended

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Trivia: Try statement song reference to just being reckless with code

A

“Jump” - Van Halen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Do dictionaries exist as a data type in Python?

A

Yes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Trivia: TV show reference for objects and connections

A

Avatar: The Last Airbender (“All Connected”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Functions attached to objects are usually called:

A

Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Trivia: In reference to door objects, what TV show was used?

A

Get Smart (Revolving Door Scene)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is inheritance?

A

When a variable of a certain object type inherits all the variables, functions/methods associated with it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is polymorphism?

A

Conversion of methods to suit an appropriate output for the input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you initialize a variable of a given type or class?

A

With a constructor (or initializer method)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is an instance variable?

A

A variable of a particular class, i.e. “Daniel” is an instance variable of class “human”, just one particular object under that umbrella

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a class?

A

A particular “type” of object/variable you define, such as “human”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a class variable?

A

A variable which pertains to a whole class of objects rather than a particular instance variable. “The number of human objects declared so far” refers to the whole class and not particular instances.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is an instance value?

A

A value which pertains to a particular object of a class, such as Daniel.height (height attribute of instance variable Daniel)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Function __init__() ?

A

Interpreter assumes that if a function has this name formatting, it is to be used as the means of of initializing an object of this class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly