home ~ projects ~ socials

Break Out Of A For Loop In Python

Break out of a for loop with `break`:

list = ['a', 'b', 'c']

for item in list:
    if item == 'b':
        break
-- end of line --