enumerate()返回一个enumerate对象实例,是一个迭代器,返回连续包含一个计数和一个值的元组。在面对已经解压后的元组序列上应该注意: items = [(1, 2), (3, 4), (5, 6)]# 正确方式for n, (x, y) in enumerate(items): print(n, *(x, y))# 错误方式!!!for n, x, y in enumerate(items): print(n, x, y)