python3 zip函数
来源:互联网 发布:lof基金 知乎 编辑:程序博客网 时间:2024/05/17 09:38
zip()的基本使用方法
首先看help(zip):
Help on built-in function zip in module __builtin__:zip(...) zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)] Return a list of tuples, where each tuple contains the i-th element from each of the argument sequences. The returned list is truncated in length to the length of the shortest argument sequence.None
python3中输出需要加list:
zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ,seq3[0]...), (seq1[1],seq2[1],...)(...)]x = [1, 2, 3]#x[1]=1y = [3, 4, 5]zipped1 = zip(x, y)print(list(zipped1))x=[[1,0,1], [0,1,0], [1,1,0]]#x[1]=[1,0,1],y[1]=1y=[1,0,1]zipped2=zip(x,y)print(list(zipped2))
输出:
[(1, 3), (2, 4), (3, 5)]
[([1, 0, 1], 1), ([0, 1, 0], 0), ([1, 1, 0], 1)]
阅读全文
0 0
- python3 zip函数
- python3.x的zip函数用法
- python3.5版本中的zip函数
- python3 zip()
- python3 zip的用法
- Python3.6 zip lambda
- 【python学习笔记】python2.x与python3.x版本中zip函数的不同
- python3 ZIP文件密码破解
- zip 函数
- zip函数
- python3 函数
- Python3 函数
- Python3函数
- python3 函数
- Python3函数
- Python3 函数
- python3函数
- Python3 函数
- CSDN下载积分的获取方式
- 加拿大银行行长:比特币“让我彻夜难眠”
- Xcode代码字体变成白色,无法出现联想代码解决方案
- 金链盟基于BCOS平台,重磅推出金融升级版—FISCO BCOS
- Stanford机器学习---第三讲. 逻辑回归和过拟合问题的解决 logistic Regression & Regularization
- python3 zip函数
- 解决ssh中的”Connection closed by 10.0.0.21“问题
- 以太币、瑞波币、莱特币进入彭博终端
- linux下寻找jdk安装包
- HTML标签总汇--一览表
- Zabbix 监控 Windows下MySQL
- 美国财政部报告:DLT数据存储引起监管担忧
- CFTC提出加密货币“交付”定义
- 万云:区块链可帮助公证行业创新改革,为互联网公证打下基础