阅读量:110

在python中对列表进行遍历并获取列表索引的方法
colours = ["red","green","blue"]
for i, colour in enumerate(colours):
print i, colour

在python中对列表进行遍历并获取列表索引的方法
colours = ["red","green","blue"]
for i, colour in enumerate(colours):
print i, colour