python遍历数组获取下标

发表于

通过枚举实现

a = [1,2,3,4,5,6]
for i,j in enumerate(a):
    print(i,j)

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注