Boss

Boss: Gatekeeper Dialogue

The boss
Boss Fight!
Every passing test breaks a shield.

The Gate of Lumen guards the brightest lantern in all of Pythonia. Its old stone gatekeeper has started letting in anyone who mumbles, even travellers carrying open torches near the oil stores! The Guild asks you to rewrite its dialogue.

Assignment

Complete gatekeeper(name, password, item):

  1. Clean name with .strip().title() (so " ada lovelace " becomes "Ada Lovelace").
  2. If the cleaned name is empty, return "Who goes there?"
  3. The password is "starlight", but ignore spaces and capitals. If it's wrong, return f"Wrong password. Begone, {name}!"
  4. item is a string or None. If it's not None and contains "torch" (any capitals), return f"{name}, leave the torch outside."
  5. Otherwise return f"Welcome, {name}! The gate opens."

Use the cleaned name in every reply.