promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

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

Checkpoint

One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.

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.