自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(5)
  • 收藏
  • 关注

原创 手动实现pythonlist的索引和切片功能

直接上代码 class Fib(object): def __init__(self): self.__a, self.__b = 0, 1 # 返回迭代对象 def __iter__(self): return self # 返回迭代对象的下一个值 def __next__(self): self....

2018-10-26 00:32:58 408

原创 python if __name__ == __main__:的一点理解

大家都知道在python中具有前后双下划线的变量是有特殊作用的变量 这个__name__指的是该文件的调用属性 主动调用该文件时,该文件的调用属性是‘__main__’ if __name__ == '__main__': pass 就不难理解了 主动执行时则执行pass部分 被动import时忽视pass部分...

2018-10-22 22:22:03 220

转载 decorator实现任意参数调用

上栗子 import time, functools from inspect import isfunction def run_time(param): text = None # run_time 无参数时调用 def decorator_text(param): return decorator(param) # 用wra...

2018-10-22 08:48:55 451

原创 递归的最佳实例

上栗子 def recursion_trim(param): if len(param) == 0 or param[0] != ' ' and param[-1] != ' ': return param if param[0] == ' ': param = param[1:] if param[-1] == ' ': ...

2018-10-20 23:43:18 167

原创 关于python filter和generator的一点思考

上栗子 def _odd_iter(): n = 1 while True: n = n + 2 yield n def _not_divisible(n): return lambda x: x % n > 0 def primes(): yield 2 it = _odd_iter() # 初始序列 ...

2018-10-20 23:18:02 330

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除