摘要: 一、文件的读操作 例1 例2:readline readable 例3,readlines:返回是一个列表形式 二、文件的写操作 w 模式:这种模式打开文件时就会把原有的内容清空掉 例1 三、其他操作 r+ w+ a a+ 阅读全文
posted @ 2018-04-28 11:04 遥望那月 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 1、abs函数,求绝对值。 返回:3 2、all函数:判断是否是可迭代对象。 官方解释:Return True if bool(x) is True for all values x in the iterable. If the iterable is empty, return True. 3、 阅读全文
posted @ 2018-04-28 09:38 遥望那月 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 一、map函数 1、自定义函数,实现类似于map函数的功能 2、map函数的运用:作用于成哥序列,让整个序列实现想要的转换 二、filter函数 1、自定义函数,实现类似于filter的功能 例1:铺垫 例2 2、filter函数运用:主要筛选出想要的元素 三、reduce函数: 1、 例1 结果: 阅读全文
posted @ 2018-04-28 01:25 遥望那月 阅读(188) 评论(0) 推荐(0) 编辑