for in loop with early end using break

  • break


examples/loops/for_break.py

txt = 'hello world'
for ch in txt:
    if ch == ' ':
        break
    print(ch)

print("Here")
h
e
l
l
o
Here