python核心编程-map处理多个序列
来源:互联网 发布:汉高薪资待遇 知乎 编辑:程序博客网 时间:2024/06/06 10:45
#!/usr/bin/env python# -*- coding: UTF-8 -*-'''一个函数处理多个序列'''print map(lambda x, y: x + y, [1,3,5], [2,4,6])print map(lambda x, y: (x+y, x-y), [1,3,5], [2,4,6])print map(None, [1,3,5], [2,4,6])print zip([1,3,5], [2,4,6])
输出:
D:\Python27\test>func17.py[3, 7, 11][(3, -1), (7, -1), (11, -1)][(1, 2), (3, 4), (5, 6)][(1, 2), (3, 4), (5, 6)]D:\Python27\test>
0 0
- python核心编程-map处理多个序列
- python核心编程&序列
- python函数式编程-----序列处理函数:map(),filter(),reduce()
- python核心编程-map函数
- Python核心编程之序列
- python核心编程6-序列
- 《python核心编程》序列类型小结2
- python核心编程-正则表达式之-匹配多个字符串
- python核心编程-第一个GUI程序
- 2015-05-12-python核心编程(六)Python序列
- Python 核心编程笔记 第六章 序列(字符串部分)
- Python 核心编程笔记 第七章 序列(映射&集合)
- Python核心编程之第一个Python程序
- python 核心编程 练习题
- 《Python核心编程》目录
- Python核心编程笔记
- Python 核心编程 笔记
- python核心编程笔记
- Angular JS 学习笔记五
- 从零开始学c语言教程
- Mac 下 破解 sublime text 2 方法详解
- python核心编程-map函数
- excel排版:人工定制列宽时部分列宽参数
- python核心编程-map处理多个序列
- ssh登录报错-bash: fork: retry: Resource temporarily unavailable
- Linux下Redis开机自启(Centos)
- Bootstrap 3 + MVC 5 - validation css tips
- 灾难的一天:“SSL_connect SYSCALL”和“the scheme https does not accept registry part”两种错误
- IOS开发记录(一)
- 渐变动画/按钮/图片拉伸/copy/KVC/KVO
- POJ 1426 Find The Multiple
- 徒步一千里 (1930) (長津惠山)