Exercise 5: Duplicate Letters — the Two-List Way — Possible Solution ==================================================================== word = "bookkeeper" my_list = [] duplicates = [] for ch in word: if ch not in my_list: my_list.append(ch) elif ch not in duplicates: duplicates.append(ch) print(duplicates) Output: ['o', 'k', 'e'] WHY THIS WORKS AS AN ANSWER ------------------------------ "bookkeeper" is a genuinely good stress test for the elif guard: "o" appears twice, "k" appears twice, and "e" appears three times in a row (the "eee" in "keeper"). Walking through it — b, o (new), o (seen, not yet flagged -> added to duplicates), k (new), k (seen, not yet flagged -> added to duplicates), e (new), e (seen, not yet flagged -> added to duplicates), p, e (seen, ALREADY flagged this time -> elif ch not in duplicates is False, so nothing happens), r. That last e is exactly why the elif ch not in duplicates check exists — without it, "e" would have been appended to duplicates twice, once for the second occurrence and again for the third, breaking the "print each duplicate exactly once" requirement.