python的enumerate函数

python的enumerate函数用于循环索引和元素

  例如

  

 foo = 'abc'
 for i , ch in enumerate(foo):
	print ch, '(%d)' % i

输出结果:	
a (0)
b (1)
c (2)
原文地址:https://www.cnblogs.com/darktime/p/3342416.html