Code Room
Code reviewHard
Question
Review this Python that enforces unique display names by lowercasing and checking against the set of claimed keys.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
def make_key(name): return name.strip().lower() def claim_name(name, taken): key = make_key(name) if key in taken: raise ValueError('name taken') taken.add(key) return key # u1 = claim_name('caf\u00e9', taken) # NFC: U+00E9# u2 = claim_name('cafe\u0301', taken) # NFD: e + U+0301Run or narrate your approach, then ask the coach.