感谢:
https://github.com/yidao620c/python3-cookbook
如有侵权,请联系我整改。
本文章节会严格按照原书(以便和原书对照,章节标题可能会略有修改),内容会有增删。
>>> items [1, 2, 3] >>> it=iter(items) >>> it <list_iterator object at 0x0000024B94D25408> >>> next(it) 1 >>> next(it) 2 >>> next(it) 3 >>> next(it) Traceback (most recent call last): File "<input>", line 1, in <module> StopIteration >>> it=iter(items) >>> next(it) 1 >>> print(*it) 2 3 >>> print(*it)