python
追风筝的人45
微笑向暖,安之若素,你若盛开,清风自来
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python
from enum import Enum #所有枚举类是Enum类的子类 # Yellow:黄钻 Green:绿钻 Black:黑钻 Red :红钻 class VIP(Enum): Yellow=1 Green=2 Black=3 Red=4 # print(VIP.Yellow) # yellow=1 # green=2 # {'yellow':1,...原创 2018-05-21 20:59:04 · 250 阅读 · 0 评论 -
python闭包
#闭包=函数+环境变量(函数定义时候) #现场 def curve_pre(): a=25 def curve(x): return a*x*x return curve f=curve_pre() print(f(2)) # 100 # # Process finished with exit code 0 origin=0 def facto...原创 2018-05-21 22:08:46 · 193 阅读 · 0 评论 -
python
# class Test(): # pass # def __len__(self): # return 8 # def __bool__(self): # return False # test=Test() # print(bool(None)) # print(bool([])) # print(bool(test)) # Fa...原创 2018-05-23 16:19:16 · 245 阅读 · 0 评论
分享