Airlock permissions
Nobody operates an airlock on trust. Each action needs a set of permissions, from basic operator training to the commander's approval for opening the outer hatch, and the airlock's control panel checks them before it does anything.
Check one action for one crew member, then the whole list of airlock actions.
Finish stage 1 to unlock this stage.
Check that the crew member holds every permission in needed. If not, print what is missing, sorted:
Kowalska can't depressurise the airlock: missing eva_certified
needed <= granted is True when every item of needed is in granted. needed - granted is what's missing.
Finish stage 1 to unlock this stage.
The control panel shows every airlock action at once. ACTIONS maps each action to the permissions it needs. Print the crew member's name, then each action: allowed, or what is missing for it:
Kowalska: depressurise the airlock: allowed open the outer hatch: missing commander_approval, eva_certified repressurise the airlock: allowed
Loop over ACTIONS.items(); for each action, needed - granted is empty when the action is allowed.
Hints
Comparing Sets
# Instruments this experiment cannot run without
required = {"camera", "spectrometer", "drill"}
# What our lander actually carries
onboard = {"camera", "spectrometer", "drill", "magnetometer", "seismometer"}
# What a second lander carries
backup = {"radar", "weather station"}
# issubset(): is everything in required also in onboard?
print("Experiment possible?", required.issubset(onboard))
# issuperset(): the same relationship, asked from the other side
print("Lander covers it?", onboard.issuperset(required))
# The operators say the same thing in fewer characters
print(required <= onboard, onboard >= required)
# One missing instrument is enough to break it
wishlist = {"camera", "drill", "laser"}
print("Wishlist possible?", wishlist.issubset(onboard))
print("Still missing:", wishlist - onboard)
# isdisjoint(): do the two landers share anything at all?
print("Fully complementary?", onboard.isdisjoint(backup))
# Every set is a subset of itself, but never a proper subset
print(onboard.issubset(onboard), onboard < onboard)
# And an empty set fits inside absolutely everything
print(set().issubset(onboard))
Separate arguments with commas. They're passed on every Run as sys.argv[1:].