Python之enumerate函数
来源:互联网 发布:哪的java技术培训好 编辑:程序博客网 时间:2024/05/16 13:02
seasons = ['Spring', 'Summer', 'Fall', 'Winter']li1 = list(enumerate(seasons))print(li1)li2 = list(enumerate(seasons, start=1))print(li2)"""result:[(0, 'Spring'), (1, 'Summer'), (2, 'Fall'), (3, 'Winter')][(1, 'Spring'), (2, 'Summer'), (3, 'Fall'), (4, 'Winter')]""""""enumerate遍历集合的时候可以返回集合中的元素在集合中的位置,默认从0开始,但是这个也可以人为的指定"""
阅读全文
0 0
- python之enumerate函数
- python之enumerate()函数
- python之函数enumerate()
- Python之enumerate函数
- Python 之 enumerate()内建函数
- python的enumerate()函数
- python enumerate函数
- python enumerate函数
- python 中enumerate函数
- python中的enumerate函数
- python enumerate函数
- python中的enumerate函数
- python中的enumerate函数
- python中的enumerate()函数
- python中的enumerate函数
- python enumerate函数
- Python中的enumerate函数
- python的enumerate()函数
- iOS面试题:腾讯一、二面以及参考思路
- Office 2016 for Mac 免费永久使用方式
- 11.25java作业
- NOR型flash与NAND型flash的区别
- Mysql基本内容之DELETE和TRUNCATE的区别
- Python之enumerate函数
- 【裸K-D树】BZOJ 2648
- 凸包
- bzoj。1008: [HNOI2008]越狱(快速幂 组合数)
- Python 循环语句
- 我的学习记录51
- 11.30周四
- can't set headers after they are sent
- Unity移动平台优化