enumerate 模块

import os

list1 = ['a','b','c']

for index,aph in enumerate(list1)
#把可遍历对象的数据以及其索引取出分别赋值给index,aph

print(index,aph)

 

posted on 2019-01-14 18:39  小胖子方法  阅读(105)  评论(0编辑  收藏  举报

导航