promptdojo_

Mutation and the action-at-a-distance bug — step 8 of 8

Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

One last thing. AI wrote a function tag_user that's supposed to return a new user dict with one extra tag, leaving the original user alone. Right now it mutates the input.

Finish the function so the script prints two lines: the original user unchanged, and the new user with "vip" added to its tags.

Expected output:

original tags: ['pm']
tagged tags: ['pm', 'vip']

full-screen editor opens — close anytime to keep reading.