Python for循环定义三个变量——zip
2021/8/2 17:06:12
本文主要是介绍Python for循环定义三个变量——zip,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
start_lists = [1, 10, 20, 40] end_lists = [9, 19, 29, 49] lables = ['个位数', '十位数', '二十位数', '三十位数'] for (start, end, lable) in zip(start_lists, end_lists, lables): print(start, end, lable)
1 9 个位数
10 19 十位数
20 29 二十位数
40 49 三十位数
这篇关于Python for循环定义三个变量——zip的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python