Python--继承

class WslFather(object):
@property
def money(self):
return 1000000000

def smoke(self):
self.yan = '玉溪'
print('抽烟')

def drink(self):
print('喝酒')

def tangtou(self):
print('烫头')


class Wsl(WslFather):
def driver(self):
print('开车')


# xlh = Wsl()
# xlh.smoke()
# xlh.drink()
# xlh.tangtou()
# print(xlh.money)
# print(xlh.yan)
class Animal(object):
def eat(self):
print('吃')

def huxi(self):
print('呼吸')


class Brid(Animal):
pass
posted @ 2018-02-09 16:33  王思磊  阅读(104)  评论(0编辑  收藏  举报