6.Python enumerate 特性
list1 = ["这", "是", "一个", "测试"] for index,item in enumerate(list1): print (index) for index,item in enumerate(list1): print (item)
执行结果:
list1 = ["这", "是", "一个", "测试"] for index,item in enumerate(list1): print (index) for index,item in enumerate(list1): print (item)
执行结果: