标签:top imp 笔记 iter exit except stop pre print
#迭代器
import sys
list=[1,2,3,4]
it=iter(list)
while True:
try:
print(next(it))
except StopIteration:
sys.exit()
#迭代器
it=iter(list)
print(next(it))
print(next(it))
print(next(it))
print(next(it))
标签:top imp 笔记 iter exit except stop pre print
原文地址:http://www.cnblogs.com/lystbc/p/7281563.html