Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class one(object): # this will inherit object
- def __int__(self):
- self.x = 10
- def makep(self):
- self.p = 3.12
- class two(object):
- def __init__(self):
- self.y =20
- def maked(self):
- self.d = 13
- class book(two, one): # Python supports mult-inheritance
- def pr(self):
- print("%d, %d, %d, %d" % (self.d, self.p, self.y, self.x)) #this will fail
- novel = book() # this will create instance of book() classe
- print(novel.makep())
- print(novel.maked())
- print(novel.p)
- print(novel.d)
- #print(novel.pr()) # this shall fail
- input() # wait here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement