eahil

I r confuzzled

May 25th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. # Create the Pet class and have it inherit from the object class.
  2. class Pet(object):
  3.     # Create constructor.
  4.     def __init__(self, name):
  5.         self._name = name
  6. # Create the Dog class and have it inherit from the object class.
  7. class Dog(Pet):
  8.     # Create constructor.
  9.     def __init__(self, fur = ""):
  10.         # Try and append the constructor with the Pet class.
  11.         Pet.__init__(self, name):
  12.         self._fur = fur
Advertisement
Add Comment
Please, Sign In to add comment