Speak Object-Oriented Flashcards

1
Q

“Make a class named ??? that is-a Y.”

A

class X(Y)

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

“Class ??? has-a __init__ that takes self and ??? parameters.”

A

class X(object): def __init__(self, J)

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

“Class ??? has-a function named ??? that takes self and ??? parameters.”

A

class X(object): def M(self, J)

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

“Set ??? to an instance of class ???.”

A

foo = X()

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

“From ???, get the ??? function, and call it with self=??? and parameters ???.”

A

foo.M(J)

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

“From ???, get the ??? attribute, and set it to ???.”

A

foo.K = Q

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