标签:style blog ar sp for on 2014 log as
第一种,最常用的,通过for in遍历数组
colours = ["red","green","blue"] for colour in colours: print colour # red # green # blue
colours = ["red","green","blue"] for i in range(0, len(colours)): print i, colour[i] # 0 red # 1 green # 2 blue
标签:style blog ar sp for on 2014 log as
原文地址:http://blog.csdn.net/wanglei9876/article/details/41652363