Symptom
After duplicating an expense, modifying the metadata on the duplicate also changes the original's metadata.
original = Expense(50.0, "food", "Dinner", date(2024, 1, 1),
metadata={"receipt": "img001.jpg"})
dup = original.duplicate()
dup.metadata["receipt"] = "img999.jpg"
print(original.metadata["receipt"]) # "img999.jpg" — original changed!
What you know
The duplicate() method should create a fully independent copy with a new ID and timestamp. The duplicate should not share any mutable state with the original.
Hints
Python
Python ready
Test Output
▶
Click "Run Tests" to execute your code