JJoeven

Exercises / prompt

Extract JSON from a fence

extract_json(text) finds the first { and last } and json.loads that slice. Handle a markdown-fenced model reply.

Live Pythonpython
Output
Run to execute this in your browser. Nothing is sent to a server.