enumerate枚举函数:

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xianqianshi3004/article/details/85218722
enumerate(sequence, [start=0])
>>> list(enumerate(seasons, start=1))       # 下标从 1 开始
[(1, 'Spring'), (2, 'Summer'), (3, 'Fall'), (4, 'Winter')]

猜你喜欢

转载自blog.csdn.net/xianqianshi3004/article/details/85218722