import os list1 = ['a','b','c'] for index,aph in enumerate(list1) #把可遍历对象的数据以及其索引取出分别赋值给index,aph print(index,aph)