IN THE STORY
The friends want to collect examples for Code Chronicles without automatically running somebody else's program.
The idea
JSON is a text format for structured data. json.dumps turns a dictionary into JSON text; json.loads turns it back into data. The code field below contains a string, not instructions being run. The example stays in memory. Saving to disk can be added later when file handling has been taught.
Your mission
Convert entry to JSON text, then read it back and display the author and code fields.
Replace ____ with the missing expression, then choose Run code. Match the expected output before trying your own changes.
Before you run it
Will the program print Hello on its own, or display the characters print("Hello")?
A little help?
Hint 1: a nudge
The conversion helper belongs to the imported json module.
Hint 2: a closer look
Use json.dumps(entry).
How the answer works
The code is displayed as text. No eval, exec or import of the contribution is used. A public sharing platform would need additional design; this example is only a local record.
This replaces the code in the editor. Save your version first if you want to keep it.
Make it yours
Add a title field. Try quotes and multiple lines in the code string and confirm the round trip preserves them.