Break Out Of A For Loop In Python

October - 2021

Break out of a for loop with break:


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

for item in list:
    if item == 'b':
        break