摘要: 1 from collections import deque 2 3 4 def search(lines, pattern, history=5): 5 previous_lines = deque(maxlen=history) # 只取history值列 6 # 提供了两端都可以操作的序列, 这意味着, 你可以在序列前后都执行添加或删除, 7 ... 阅读全文
posted @ 2019-11-15 16:31 jescs 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Deque模块是Python标准库collections中的一项. 它提供了两端都可以操作的序列, 这意味着, 你可以在序列前后都执行添加或删除. https://blog.csdn.net/qq_33374294/article/details/89339688 python中yield的用法详解 阅读全文
posted @ 2019-11-15 16:10 jescs 阅读(205) 评论(0) 推荐(0) 编辑
摘要: cookbook 中有 等价于 解释:如果tail 存在 ture 返回 head +sum(tail),否则返回 head 阅读全文
posted @ 2019-11-15 14:27 jescs 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1.输入一个数值,判断是否为正数,负数,小数,以及字符串 2:输入五位数组成一个列表,并求和 阅读全文
posted @ 2019-11-15 11:31 jescs 阅读(338) 评论(0) 推荐(0) 编辑