Python ex41

Card Set Information

Author:
SimonWF
ID:
292291
Filename:
Python ex41
Updated:
2014-12-31 20:56:40
Tags:
Py Python ex41 Learning Speak OOP Object Oriented Programing class object instance def self has attribute composition inheritance
Folders:
LPTHW
Description:
Learning Python Word Drills http://learnpythonthehardway.org/book/ex41.html
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user SimonWF on FreezingBlue Flashcards. What would you like to do?


  1. class X(Y)
    Make a class named X that is-a Y
  2. class X(object): def __init__(self, J)
    class X has-a __init__ that takes self and J parameters
  3. class X(object): def M(self, J)
    class X has-a function named M that takes self and J parameters.
  4. foo = X()
    Set foo to an instance of class X
  5. foo.M(J)
    From foo get the M function and call it with parameters self, J
  6. foo.K = Q
    From foo get the K attribute and set it to Q

What would you like to do?

Home > Flashcards > Print Preview