Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class main_class:
- def __init__(self, fd):
- self.fd = fd
- class sub_class(main_class):
- def __init__(self, fd = "cat"):
- self.fd = fd
- obj1 = main_class("dog")
- obj2 = sub_class("eel")
- obj3 = sub_class()
- print(obj1.fd)
- print(obj2.fd)
- print(obj3.fd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement