
Boss
Boss: Gatekeeper Dialogue

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):
- Clean
namewith.strip().title()(so" ada lovelace "becomes"Ada Lovelace"). - If the cleaned name is empty, return
"Who goes there?" - The password is
"starlight", but ignore spaces and capitals. If it's wrong, returnf"Wrong password. Begone, {name}!" itemis a string orNone. If it's notNoneand contains"torch"(any capitals), returnf"{name}, leave the torch outside."- Otherwise return
f"Welcome, {name}! The gate opens."
Use the cleaned name in every reply.
Complete gatekeeper(name, password, item):
- Clean
namewith.strip().title()(so" ada lovelace "becomes"Ada Lovelace"). - If the cleaned name is empty, return
"Who goes there?" - The password is
"starlight", but ignore spaces and capitals. If it's wrong, returnf"Wrong password. Begone, {name}!" itemis a string orNone. If it's notNoneand contains"torch"(any capitals), returnf"{name}, leave the torch outside."- Otherwise return
f"Welcome, {name}! The gate opens."
Use the cleaned name in every reply.
main.py Python sleeping
Press Run to try your code, then Check to test it.