For循环的实质

For循环的实质

1、调用可迭代对象的iter方法返回一个迭代器对象

2、不断调用迭代器对象的next方法

3、处理StopIteration

posted @ 2017-10-26 10:16  xsan  阅读(200)  评论(0编辑  收藏  举报