AI Agents by HandAll problemsAbout

All problems › Python drill · easy · ~4 min

d03 · Build handlers from a table

late binding

Solve it in your browser →

d03 · Build handlers from a table (~4 min)

Mutation and references. Edit drills.py. Standard library only; no model calls, no API key.

def build_converters(factors):

factors maps a tool name to a multiplier, e.g. {"km_to_mi": 0.621371}.

Return {name: handler} where handler(value) returns value * that name's factor. Handlers use the factors as they were when build_converters was called; later changes to factors don't affect them.

Failure messages are enough to go on, so leave the tests unread until you submit.

Starter code and hidden tests open in the editor. Nothing to install.