1 #!/usr/bin/env python2 obj = iter([11,22,33,44])3 #iter 创建一个可以被迭代的对象4 print(obj)5 r1 = next(obj)6 print(r1)7 8
结果:C:\Python35\python3.exe F:/Python/2day/c4.py11Process finished with exit code 0
本文共 268 字,大约阅读时间需要 1 分钟。
1 #!/usr/bin/env python2 obj = iter([11,22,33,44])3 #iter 创建一个可以被迭代的对象4 print(obj)5 r1 = next(obj)6 print(r1)7 8
结果:C:\Python35\python3.exe F:/Python/2day/c4.py11Process finished with exit code 0
转载于:https://www.cnblogs.com/shiluoliming/p/6383059.html