Home
Flashcards
Preview
Python Phrase Drills
Home
Get App
Take Quiz
Create
class X(Y)
"Make a class named X that is-a Y."
class X(object):
def__init__(self, J)
"class X has-a __init__ that takes self and J parameters."
class X(object):
def M(self, J)
"class X has-a function named M that takes self and J parameters."
foo = X()
"Set foo to an instance of class X."
foo.M(J)
"From foo get the M function, and call it with parameters self, J."
foo.k = Q
"From foo get the k attribute and set it to Q."
Author
Anonymous
ID
280827
Card Set
Python Phrase Drills
Description
Python phrase drills for classes
Updated
8/18/2014, 7:28:01 PM
Show Answers
Home
Flashcards
Preview