l = ['a','b','c','d','e','f'] for i in enumerate(l):#枚举函数 print(i) for index,item in enumerate(l):#枚举函数 print(index,item)#打印索引和值
运行结果: