-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathSets.py
More file actions
22 lines (17 loc) · 749 Bytes
/
Copy pathSets.py
File metadata and controls
22 lines (17 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# event_checkin.py
from typing import Set
def merge_guest_lists() -> None:
rsvp_set: Set[str] = {"alice@mail.com", "bob@mail.com", "charlie@mail.com", "alice@mail.com"}
walkin_set: Set[str] = {"diana@mail.com", "alice@mail.com", "eve@mail.com"}
# Automatic deduplication
all_guests = rsvp_set | walkin_set # Union
print(f"✅ Unique guests: {len(all_guests)}")
# Find overlaps
vip_list = {"alice@mail.com", "charlie@mail.com"}
vip_present = vip_list & rsvp_set # Intersection
print(f"🌟 VIPs confirmed: {vip_present}")
# Who RSVP'd but didn't show?
no_show = rsvp_set - walkin_set # Difference
print(f"📭 No-shows: {no_show}")
if __name__ == "__main__":
merge_guest_lists()