← back to unit
Easy
# power tools easy
Have We Met?
The party host never forgets a face — because the host keeps a set. 🎉
You get the guests who came before and one name at the door. Print welcome back if they've visited, or new face if not. Remember Unit 0's search loop? A set does that check in ONE step: name in guestset.
Example:
Input: guests = ["mia", "leo", "zara"], name = "leo"
Output: welcome back
"leo" is inside the guest set, so it's a familiar face — print welcome back.
Input: guests = ["mia", "leo"], name = "finn"
Output: new face
"finn" isn't in the set at all, so print new face.
💡 need a hint?
pt-have-we-met.py🔒 given lines are locked — write your code in between
loading...