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