Manifest diff
The manifest changes every day as items are packed and unpacked. The loading supervisor doesn't want to read both lists side by side: she wants to know what changed.
Work out what was added and what was removed, then how much stayed the same.
Finish stage 1 to unlock this stage.
Print which IDs were added since yesterday and which were removed, each list sorted:
Added: CG-0047, CG-0048 Removed: CG-0043, CG-0045
set(today) - set(yesterday) is what today has that yesterday didn't. A set has no order, so sort it before joining.
Finish stage 1 to unlock this stage.
Add a line with how many IDs are on both lists, and print none when nothing was added or removed:
Added: CG-0047, CG-0048 Removed: CG-0043, CG-0045 Unchanged: 3
set(today) & set(yesterday) is what both lists have.
Hints
Mathematical Set Operations
# Asteroids picked up by two different sky surveys last night
catalina = {"Apophis", "Bennu", "Eros", "Didymos"}
panstarrs = {"Bennu", "Didymos", "Ceres", "Vesta"}
# Union: everything either survey saw
print("Seen by anyone:", catalina | panstarrs)
print("Total objects:", len(catalina | panstarrs))
# Intersection: only what both surveys caught
print("Confirmed by both:", catalina & panstarrs)
# Difference: in the first set and not in the second
print("Only Catalina:", catalina - panstarrs)
print("Only Pan-STARRS:", panstarrs - catalina)
# Symmetric difference: seen by exactly one survey, never by both
print("Needs follow-up:", catalina ^ panstarrs)
# Every operator has a spelled-out method that does the same job
print(catalina.union(panstarrs) == catalina | panstarrs)
print(catalina.intersection(panstarrs) == catalina & panstarrs)
# None of that changed the original sets
print("Catalina still holds", len(catalina), "objects")
Separate arguments with commas. They're passed on every Run as sys.argv[1:].