How do I leave a loop early in python?
for a in b:
if criteria in list1:
print "oh no"
#Force loop i.e. force next iteration without going on
someList.append(a)
Also, in java you can break out of a loop, is there an equivalent in Python?
continueandbreakis what you want. Python works identically to Java/C++ in this regard.