python遍历数组获取下标 代码 通过枚举实现 a = [1,2,3,4,5,6] for i,j in enumerate(a): print i,j 结果 0 1 1 2 2 3 3 4 4 5 5 6