![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
coder_mckee
暂无
展开
-
Python之正则表达式入门
突然想整理一下以前学的比较重要的东西。趁吃饭前,把正则表达式整理下吧。(谨适用于入门)一、如何查找关键词格式:关键词,如there或There 输出:所有包含关键词的句子import rehandle = open('example.txt')for line in handle: line = line.strip() if re.search('there...原创 2017-10-29 14:13:24 · 368 阅读 · 0 评论 -
函数式编程
一、lambda函数二、map函数形式:map(function,list) 功能:将list中的元素依次作为function中的实参 三、filter函数形式:filter(function,list) 功能:function一般为判断函数,返回值为bool类型,将list中的元素作为实参传入function,将返回true的元素组成list输出 四、reduce函数形式:reduce(f原创 2017-12-04 22:15:30 · 336 阅读 · 0 评论