← Quiz: Tools and Agents: all 10 questions
Quiz: Tools and Agents · Question 7 of 10
What does this print? (code)
What does this print?
HANDLERS = {"get_attendance": lambda roll: {"roll": roll, "DSA": 68}}
request = {"name": "delete_student", "input": {"roll": 104}}
handler = HANDLERS.get(request["name"])
print("blocked" if handler is None else handler(**request["input"]))
- A.{'roll': 104, 'DSA': 68}
- B.Error: KeyError
- C.blocked
- D.None
Answer & explanation
Correct answer: blocked
The dispatch table is an allowlist: the model can reach only the functions in it.
Can you get the rest right without peeking?
Take the timed Quiz: Tools and Agents quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →