Advertisement
Guest User

Untitled

a guest
Aug 31st, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. class main_class:
  2.     def __init__(self, fd):
  3.         self.fd = fd
  4.  
  5. class sub_class(main_class):
  6.     def __init__(self, fd = "cat"):
  7.         self.fd = fd
  8.  
  9. obj1 = main_class("dog")
  10. obj2 = sub_class("eel")
  11. obj3 = sub_class()
  12.  
  13. print(obj1.fd)
  14. print(obj2.fd)
  15. print(obj3.fd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement