摘要: > 中国------------------- 中国 > 中国-------------------实例 》 中国 阅读全文
posted @ 2018-07-19 07:25 一棵大树一棵小树一棵草 阅读(91) 评论(0) 推荐(0) 编辑
摘要: class Chinese: country='China' def __init__(self,name): self.name=name def play_ball(self,ball): print('%s 正在打 %s' %(self.name,ball))p1=Chinese('alex' 阅读全文
posted @ 2018-07-19 06:55 一棵大树一棵小树一棵草 阅读(109) 评论(0) 推荐(0) 编辑
摘要: class Chinese: "cdfgrgfrth" country='China' def __init__(self,name): self.name=name def play_ball(self,ball): print('%s 正在打 %s' %(self.name))#查看print( 阅读全文
posted @ 2018-07-19 04:50 一棵大树一棵小树一棵草 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 实例字典不包括函数属性,因为实例化就是执行_init_函数,实例使用数据属性 所以他的函数作用域就是_init_函数 实例能访问类属性,但是累属性不能访实例属性, 阅读全文
posted @ 2018-07-19 04:04 一棵大树一棵小树一棵草 阅读(71) 评论(0) 推荐(0) 编辑
摘要: python为类内置的特殊属性 类名.__name__# 类的名字(字符串) 类名.__doc__# 类的文档字符串 类名.__base__# 类的第一个父类(在讲继承时会讲) 类名.__bases__# 类所有父类构成的元组(在讲继承时会讲) 类名.__dict__# 类的字典属性 类名.__mo 阅读全文
posted @ 2018-07-18 17:39 一棵大树一棵小树一棵草 阅读(84) 评论(0) 推荐(0) 编辑
摘要: # class Chinese:# '这是一个中国人的类'# pass## print(Chinese)## #实例化到底干了什么?# p1=Chinese() #实例化# print(p1)'''1.数据属性2.函数属性'''class Chinese: '这是一个中国人的类' dang='党' 阅读全文
posted @ 2018-07-18 08:57 一棵大树一棵小树一棵草 阅读(126) 评论(0) 推荐(0) 编辑
摘要: #用面向对象编程独有的语法class去实现面向对象设计class Dog: def __init__(self,name,gender,type): self.name=name self.gender=gender self.type=type def bark(self): print('一条名 阅读全文
posted @ 2018-07-18 06:22 一棵大树一棵小树一棵草 阅读(125) 评论(0) 推荐(0) 编辑
摘要: {'name': '元昊', 'gender': '母', 'type': '中华田园犬', 'jiao': <function dog.<locals>.jiao at 0x005D5270>, 'chi_shi': <function dog.<locals>.chi_shi at 0x005D 阅读全文
posted @ 2018-07-17 08:19 一棵大树一棵小树一棵草 阅读(127) 评论(0) 推荐(0) 编辑
摘要: match方法 split分割 a=re.split(' ','fsd fss gter f') 阅读全文
posted @ 2018-07-16 05:08 一棵大树一棵小树一棵草 阅读(105) 评论(0) 推荐(0) 编辑
摘要: |或的意思 阅读全文
posted @ 2018-07-16 02:54 一棵大树一棵小树一棵草 阅读(78) 评论(0) 推荐(0) 编辑