Use
raise StopIteration:try:
for loop:
for loop:
for loop:
if condition:
raise StopIteration()
except StopIteration
pass
Comments
Post a Comment