# break — the emergency exit
# break stops the loop immediately — no more iterations

# ─────────────────────────────────────────────
# Basic break
# ─────────────────────────────────────────────

word = "RedHorn"

for letter in word:
    if letter == "H":
        print("Found H — stopping.")
        break
    print(letter)

# R
# e
# d
# Found H — stopping.
# "o", "r", "n" — never reached

# ─────────────────────────────────────────────
# continue vs break
# ─────────────────────────────────────────────

word = "Bull"

# continue — skips one iteration, loop keeps going
for letter in word:
    if letter == "u":
        continue
    print(letter)
# B / l / l

# break — stops the loop entirely
for letter in word:
    if letter == "u":
        break
    print(letter)
# B

# ─────────────────────────────────────────────
# Real example — find first vowel
# ─────────────────────────────────────────────

word = input("Enter a word: ")
found = False

for letter in word:
    if letter.lower() in "aeiou":
        print(f"First vowel found: {letter}")
        found = True
        break

if not found:
    print("No vowels found.")

# ─────────────────────────────────────────────
# Quick reference
# ─────────────────────────────────────────────

# break stops the entire loop — not just the current iteration
# everything after break in the loop is never reached
# always use with a condition — alone it stops on the first iteration
# continue skips one iteration — break ends the loop
