I use this code quite often, and every time I do this, I think there may be a better and clearer way to express myself:
do_something = True # Check a lot of stuff / loops for thing in things: .... if (thing == 'something'): do_something = False break if (do_something): # Do something
Essentially, βplan to do something, but if this particular condition is found anytime, anywhere, don't do itβ
This code might work fine, but I wanted to see if anyone has a better suggestion.
Thanks for any input.
source share