# What if your loop had two lanes?
# zip() — two sequences, one loop, items matched by position

# ─────────────────────────────────────────────
# Basic zip() — strings split into words
# ─────────────────────────────────────────────

names = "Bull Horn Red"
scores = "85 92 78"

for name, score in zip(names.split(), scores.split()):
    print(f"{name}: {score}")

# Bull: 85
# Horn: 92
# Red: 78

# .split() separates a string into words
# list explained later — for now: "separate into individual words"

# ─────────────────────────────────────────────
# Zipping strings — character by character
# ─────────────────────────────────────────────

word_a = "Bull"
word_b = "Horn"

for a, b in zip(word_a, word_b):
    print(f"{a} — {b}")

# B — H
# u — o
# l — r
# l — n

# ─────────────────────────────────────────────
# Different lengths — stops at the shortest
# ─────────────────────────────────────────────

word_a = "Bull"
word_b = "Hi"

for a, b in zip(word_a, word_b):
    print(f"{a} — {b}")

# B — H
# u — i

# extra items are silently ignored — no error

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

# for a, b in zip(sequence_a, sequence_b):
#     — a: current item from sequence_a
#     — b: current item from sequence_b
#
# items matched by position — first with first, second with second
# stops at the shortest sequence — extra items ignored, no error
# variable names are up to you — pick something readable
