Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesSenior Deep-DivesModule 6 · FAANG-2026 deep divesSentinel object — distinguishing 'not passed' from 'passed None'predict115 / 161
+150 XP
Task
📝 **Task:** Predict the exact output. \`merge\` distinguishes three cases via \`is _MISSING\` and \`is None\`. Four calls: no override, explicit None, explicit value, explicit sentinel. 📋 Implement the function above. Tests run automatically. 💡 **Hint:** Re-read the theory if you get stuck.
Predict the output

Read the code carefully

_MISSING = object()


def merge(base, override=_MISSING):
    if override is _MISSING:
        return f"no override (base={base})"
    if override is None:
        return f"explicit None (base={base})"
    return f"override={override} (base={base})"


print(merge(1))
print(merge(1, None))
print(merge(1, 99))
print(merge(1, _MISSING))

What will the program print? Write here:

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…