🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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"]))
  1. A.{'roll': 104, 'DSA': 68}
  2. B.Error: KeyError
  3. C.blocked
  4. 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 →