PythonStudy——枚举 enumerate # 给可迭代器对象及迭代器对象添加迭代索引 s = 'abc' for v in enumerate(s): print(v) # (0 'a') | (1 'b') | (2 'c')