# for meets if — the most common pattern in Python
# loop visits everything — if decides what to do with each visit

# ─────────────────────────────────────────────
# Basic for + if
# ─────────────────────────────────────────────

word = "RedHorn"

for letter in word:
    if letter == "o":
        print("Found it!")

# Found it!

# ─────────────────────────────────────────────
# for + if + else
# ─────────────────────────────────────────────

word = "Bull"

for letter in word:
    if letter == "u":
        print(f"{letter} — vowel")
    else:
        print(f"{letter} — consonant")

# B — consonant
# u — vowel
# l — consonant
# l — consonant

# ─────────────────────────────────────────────
# Counter with for + if
# ─────────────────────────────────────────────

word = "RedHorn"
count = 0

for letter in word:
    if letter.lower() in "aeiou":
        count += 1

print(f"Vowels found: {count}")    # Vowels found: 2

# loop visits every character
# if catches only vowels
# counter tracks them

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

# for item in sequence:       — visits every item
#     if condition:           — checks each item
#         block               — runs only when condition is True
#
# indentation stacks — if block is 8 spaces from the left
# in checks membership — letter in "aeiou" is True if letter is a vowel
# combine with counter to track specific items
