首页 > 编程 > Python > 正文

python之函数enumerate()

2019-11-11 05:14:11
字体:
来源:转载
供稿:网友

enumerate函数可以遍历列表

for i in range(len(a)):PRint a[i]

等价于:

for index,item in enumerate(a):print index,item
上一篇:一行python打印乘法表

下一篇:python 练习

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表