OOPS Phrase Drill Flashcards

(6 cards)

1
Q

Class X(Y)

A

Make a class named X that is-a Y

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
class X(object): 
    def \_\_init\_\_(self, J)
A

class X has-a init that takes self and J parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
class X(object): 
    def M(self, J)
A

class X has-a function named M that takes self and J parameters.

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

foo = X()

A

Set foo to an instance of class X

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

foo.M(J)

A

from foo, get the M function, and call it with parameters self, J.

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

foo.K = Q

A

from foo, get the K attribute, and set it to Q

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