S11 · Sat, Dec 12, 2026

Require Both Keys

Predict all four Boolean cases, repair a two-key rule with and, and unlock the Twin Star Vault.

Review the S11 Python notes

S11 · 1 / 16

S11 · Require Both Keys

The expedition reaches the Twin Star Vault. This lock opens only when both celestial keys are on.

S11 · 2 / 16

Today in Python: Boolean AND

Use two Boolean parameters and the and operator. Today is Python Journey step 11 / 30.

S11 · 3 / 16

Predict before running

Complete all four cases first. Do not run the starter yet.

False, False → ______
False, True  → ______
True, False  → ______
True, True   → ______

S11 · 4 / 16

The starter has a deliberate bug

def both_keys(first_on, second_on):
    return first_on

This ignores the second key. Compare its output with your predictions.

S11 · 5 / 16

Run all four cases

python lessons/sessions/s11/student/starter.py

Find the first case where observed output disagrees with your truth-table prediction.

S11 · 6 / 16

Repair with AND

def both_keys(first_on, second_on):
    return first_on and second_on

and is True only when both inputs are True.

S11 · 7 / 16

Expected repaired output

False
False
False
True

S11 · 8 / 16

Why only one row is True

If either key is False, the whole and expression is False. Only True AND True opens the vault.

S11 · 9 / 16

Python → package → Trail

  • Python models the two-input Boolean rule locally.
  • YAML stores two toggle IDs and two response messages.
  • Trail owns the actual key states and never imports student Python.

S11 · 10 / 16

Validate the S11 package

explore-package validate lessons/sessions/s11/student/explorer-package

S11 · 11 / 16

Launch the Twin Star Vault Trail

explore-package trail examples/explorer-packages/nova-character lessons/sessions/s11/student/explorer-package --player "nova-character:nova" --mission-id "require-all-switches-on" --name "S11 Require Both Keys"

Run the one-line command from the Course Kit folder.

S11 · 12 / 16

Show the fallback branch

Speak to the Vault Keeper while one or both keys are off. Record the fallback response.

S11 · 13 / 16

Turn both keys on

Use WASD/arrows and E. Turn on both celestial keys, then return to the keeper.

S11 · 14 / 16

Show the success branch

With both keys on, the keeper shows the success response. Displaying both branches completes M10 · Unlock the Secret.

S11 · 15 / 16

Important limitation

The fallback message is the same whether one key or both keys are off. Use your truth table—not random clicking—to reason about what is missing.

S11 · 16 / 16

Explain what you learned

  • What are the two Boolean inputs?
  • Why did the first-only starter fail?
  • Why is True AND True the only success row?

Review the Python Journey →