Home / Python Loops / How to Stop Loop Before It Has Looped Through All Items in Python In this example we will show how to stop the loop before it has looped through all the items in Python. Source Code str = 'abcdc' for x in str: print(x) if x == 'c': break Output: a b c