python 内置函数
来源:互联网 发布:macsd卡恢复软件 编辑:程序博客网 时间:2024/05/19 17:56
#filterdef fun1(s): if s != 'a': return sstr = ['a','b','c','d']f1 = filter(fun1 , str)print(list(f1))['b', 'c', 'd']#mapstr = ['1','2','3']def fun2(s): return s+'martin'var = map(fun2,str)print(list(var))['1martin', '2martin', '3martin']#reducedef add(x,y): return x+yret = reduce(add, range(1,101))print(ret)5050#lambdaprint(reduce(lambda x,y:x*y,range(1,6)))120
阅读全文
0 0
- python函数: 内置函数
- python 内置函数
- python内置函数
- Python常用内置函数
- Python常用内置函数
- python内置函数
- python 内置函数
- Python中 内置函数
- python 内置函数
- Python内置函数清单
- python的内置函数
- python模块内置函数
- 【python】内置函数
- python内置函数
- python 内置函数
- 4.8Python内置函数
- python内置函数
- Python内置函数
- for循环内局部变量的生命周期
- cadence创建原理图文件库时遇到的package Type
- 桂林两夜三日游(程序员也是要放松放松的)
- 第二期 QEMU模拟vexpress-a9开发板 《虚拟机就是开发板》
- [高维前缀和] ZROI 2017提高2 World Of Our Own
- python 内置函数
- 数据库总结(二)
- C++枚举类型详解
- mysql 一主多从配置说明
- NOIP2017清北综合强化试题
- 社团划分结果评估指标:Q、ARI、NMI
- 算法笔记 //03_众数问题
- PTA一元多项式的乘法与加法运算
- 01背包代码实现