挨个访问,直到没有出现StopIteration错误。
while true:
try:
each=next(it)
except StopIteration:
break
print(each)
for each in string:
print(each)
挨个访问,直到没有出现StopIteration错误。
while true:
try:
each=next(it)
except StopIteration:
break
print(each)
for each in string:
print(each)
原文:https://www.cnblogs.com/y1995/p/8536709.html