For循环

for循环内部做了三件事:

1.调用对象的iter()方法,返回一个迭代器对象

2.while:通过while循环调用next方法

               i= next(list_Iterator)

   

3.捕捉异常

           while:

          try:

               i= next(list_Iterator)

         except StopIteration:

               break

原文地址:https://www.cnblogs.com/qinyanli/p/8257573.html