首页 > 编程语言 > 详细

Python--继承

时间:2018-02-09 18:59:45      阅读:167      评论:0      收藏:0      [点我收藏+]
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

Python--继承

原文:https://www.cnblogs.com/wangsilei/p/8436058.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!