I am trying to write a for-loop to go through values, and if by the end of the loop it did not break, I want it to run some code. For example:
for i in range(10):
if someCondition:
break
#If the loop did NOT break, then...
doSomething()
There is a roundabout method. For example,
didNotBreak = True
for i in range(10)
if someCondition:
didNotbreak = False
break
if didNotBreak:
doSomething()
Is there a simpler method?