I'm writing a program that needs to run a for loop then either return a string or runs the next for loop. I made it so that when it returns something a variable changes and the next loop doesn't run. It works fine but I feel there is a better way to do it.
check=0
if check==0:
for j in range (0,10):
if something happens:
check=1
return('string')
if check==0:
for j in range (0,7):
if something happens:
check=1
return('string')