念念不忘,必有回响。

03 2020 档案

摘要:有以下几种方式: # nested if for l in lines: if l.startswith('example'): body # continue,to put an accent on exceptional case for l in lines: if not l.startsw 阅读全文
posted @ 2020-03-29 18:41 点点米饭 阅读(590) 评论(0) 推荐(0)
摘要:1.reduce() 函数: reduce() 函数会对参数序列中元素进行累积。reduce 有 三个参数, reduce的工作过程是 :在迭代sequence(tuple ,list ,dictionary, string等可迭代物)的过程中,首先把 前两个元素传给 函数参数,函数加工后,然后把得 阅读全文
posted @ 2020-03-28 21:31 点点米饭 阅读(392) 评论(0) 推荐(0)
摘要:Trie即前缀树或字典树,利用字符串公共前缀降低搜索时间。速度为O(k),k为输入的字符串长度。 1.采用defaultdict创建trie from collections import defaultdict from functools import reduce TrieNode = lam 阅读全文
posted @ 2020-03-28 20:58 点点米饭 阅读(853) 评论(0) 推荐(1)
摘要:① SELECT * FROM testtable LIMIT 2,1; ② SELECT * FROM testtable LIMIT 2 OFFSET 1; ③ SELECT * FROM testtable LIMIT 3; 注意: 1.数据库数据计算是从0开始的 2.OFFSET X是跳过X 阅读全文
posted @ 2020-03-20 18:22 点点米饭 阅读(4350) 评论(0) 推荐(0)