l= [1,2,3,4,56,7,89]d = iter(l)print(d)#什么是迭代器#满足两个方法: 1:有iter方法 2:有next方法print(next(d))print(next(d))print(next(d))#for 循环帮我们做的三件事#1 调用可迭代对象的iter方法,返回一个迭代器对象,不断调用迭代器对象的next方法,处理StopIterationfor x in [1,2,3,4,5]: iter([1,2,3,4,5])