mutation — why your code mysteriously breaks8 / 9
shallow copy, deep copy, and the nested-dict bug
Write a function clone_user that takes a user dict and returns a fully
independent copy — meaning if the caller mutates the cloned user's
roles list, the original user's roles list does not change.
The copy module is already imported. Two prints at the bottom check the
result. Expected output:
original roles: ['member']
cloned roles: ['member', 'admin']
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _