eahil

Untitled

May 25th, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. class Cat():
  2. def __init__(self, name):
  3. self.__name = name
  4. def getName(self):
  5. print(self.__name)
  6.  
  7. class Dog(Cat):
  8. def __init__(self, name):
  9. self.name = name
  10.  
  11. Sammy = Cat("Sammy")
  12.  
  13. Sparks = Dog("Sparks")
  14.  
  15. Sammy.name() = "Kitty"
  16.  
  17. Sparks.name() = "Spike"
Advertisement
Add Comment
Please, Sign In to add comment