作用 在遍历一个对象时,每次得到一个遍历序列和遍历内容的元祖 举个栗子 l = ['a', 'b', 'c', 'd', 'e'] for s in enumerate(l): print(s) ''' 得到的结果: (0, 'a') (1, 'b') (2, 'c') (3, 'd') (4, 'e') ''' for i, s in enumerate(l): print(i, "-", s) ''' 打印结果: 0 - a 1 - b 2 - c 3 - d 4 - e '''